yogendrayaduvanshi
yogendrayaduvanshi

Reputation: 219

how to format date 2015-12-25T10:11:14.000Z in php to store to datetime in mysql?

Hello I want to format youtube published date to mysql datetime format .

Thanks in Advance

Upvotes: 0

Views: 625

Answers (2)

ovgu12
ovgu12

Reputation: 130

http://php.net/manual/de/datetime.createfromformat.php is your friend. You should choose built-in format or create own by yourself. And then use http://php.net/manual/de/datetime.format.php to convert to MYSQL Format i think it is ISO 8601.

Upvotes: 0

georgewoofbates
georgewoofbates

Reputation: 330

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

Source: http://dev.mysql.com/doc/refman/5.7/en/datetime.html

Upvotes: 1

Related Questions