Originally posted by Smifffy
how would i convert a string like this 20021202153015
into
3:30 - 28/12/2002
Don't you mean
3:30pm - 02/12/2002?
list($year,$month,$day,$hour,$minute,$second) = sscanf($date, '%4d%2d%2d%2d%2d%2d');
$timestamp = mktime($hour, $minute, $second, $month, $day, $year);
$formatted_date = date("g:ia - d/m/Y",$timestamp);
Alternatively, if you're going to use MySQL-format timestamps out of a MySQL database, you could use MySQL functions to convert them into a more conventional format.