PHP - Convert American to European Date Format

Found a great little snippet of code to use for converting from American to Euro date format and back.

$date=’12/31/2006’;
print ereg_replace(”([0-9] )/([0-9] )/([0-9] )”,”\\2/\\1/\\3″,$date);

Thanks to last-child.com for the Snippet.




One Response to “PHP - Convert American to European Date Format”  

  1. 1 Justin Sainton

    Much simpler and more consistent results by using echo date( ‘m-d-Y’, strtotime( $date) )

Leave a Reply