Jump to content

Date conversion, quick question :).


virtuexru

Recommended Posts

  • 2 weeks later...

I need to do the same thing but this aint working for me. PHP is confusing the month with the date.

 

<?php 
$mysqlFormat = "12-01-2010"; // Dec 1, 2010
echo date('Y-m-d', strtotime("$mysqlFormat"));
?>

 

This is echoing 2010-01-12 which is wrong! This means Jan 12, 2010.

 

How can I fix this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.