Parsing strings with the date_parse() function:
<pre><?php
$date = "22apr2006 8:36:14.43 #^ Europe/Oslo CEST";
$t = date_parse( $date );
echo $t['year'], '-', $t['month'], '-', $t['day'], " ";
echo $t['hour'], ':', $t['minute'], ':', $t['second'] + $t['fraction'], " ";
echo $t['tz_id'], "\n";
if ( $t['warning_count'] )
echo "Warnings:\n";
foreach( $t['warnings'] as $pos => $message )
echo "- $message @$pos\n";
if ( $t['error_count'] )
echo "Errors:\n";
foreach( $t['errors'] as $pos => $message )
echo "- $message @$pos\n";
Output
2006-4-22 8:36:14.43 Europe/Oslo Warnings: - Double timezone specification @36 Errors: - Unexpected character @21 - Unexpected character @22