YYYY-MM-DD HH:MM:SS ~ Unix Timestamp
1 2 3 4 5 6 7 8 9 10 | function convert_datetime($stamp){ list($date, $time) = explode(' ', $stamp); list($year, $month, $day) = explode('-', $date); list($hour, $minute, $second) = explode(':', $time); $timestamp = mktime($hour, $minute, $second, $month, $day, $year); return $timestamp; } |
Just stick that in somewhere and you’re good to go, this is useful when converting between SQL and more localised formats.
