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.




3 Responses 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) )

  2. 2 Morten

    Thx Justin Sainton, just what i was looking for!

  3. 3 Moises

    In answer to Justin. With this method you can’t convert from European to American.

Leave a Reply