Jump to content

convert datetime format


playwright

Recommended Posts

You probably want a four digit year, and use H for 24 hour time or h for 12 hour:

 

 

$new_date = date('Y-m-d h:i:s', strtotime($old_date));

 

 

datetime or timestamp depends on what you need. You can read the differences here: http://dev.mysql.com/doc/refman/5.1/en/datetime.html

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.