Changeset 486 for trunk/Common/Database.php
- Timestamp:
- Feb 10, 2013, 9:20:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Database.php
r456 r486 150 150 } 151 151 152 function TimeToMysqlDateTime($Time) 153 { 154 if($Time == NULL) return(NULL); 155 else return(date('Y-m-d H:i:s', $Time)); 156 } 157 158 function TimeToMysqlDate($Time) 159 { 160 if($Time == NULL) return(NULL); 161 else return(date('Y-m-d', $Time)); 162 } 163 164 function TimeToMysqlTime($Time) 165 { 166 if($Time == NULL) return(NULL); 167 else return(date('H:i:s', $Time)); 168 } 169 170 function MysqlDateTimeToTime($DateTime) 171 { 172 if($DateTime == '') return(0); 173 $Parts = explode(' ', $DateTime); 174 $DateParts = explode('-', $Parts[0]); 175 $TimeParts = explode(':', $Parts[1]); 176 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 177 return($Result); 178 } 179 180 function MysqlDateToTime($Date) 181 { 182 if($Date == '') return(0); 183 return(MysqlDateTimeToTime($Date.' 0:0:0')); 184 } 185 186 function MysqlTimeToTime($Time) 187 { 188 if($Time == '') return(0); 189 return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 190 } 191 152 192 ?>
Note:
See TracChangeset
for help on using the changeset viewer.