[wp-trac] [WordPress Trac] #41785: I don't think the default date "0000-00-00 00:00:00" is good idea in MySQL 5.7+

WordPress Trac noreply at wordpress.org
Fri Sep 22 10:16:10 UTC 2017


#41785: I don't think the default date "0000-00-00 00:00:00" is good idea in MySQL
5.7+
--------------------------+-----------------------
 Reporter:  kmvan         |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Database      |     Version:  4.8.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------
Changes (by Collizo4sky):

 * status:  closed => reopened
 * resolution:  duplicate =>


Comment:

 @dd32 the date format is correct. The issue is the default value of
 `0000-00-00 00:00:00`. Please read through
 https://stackoverflow.com/questions/23153822/mysql-datetime-default-
 current-timestamp-error

 Setting it to `1000-01-01 00:00:00` or epoch time `1970-01-01 00:00:00`
 will fix this. And it's backward compatible with older MySQL versions. So
 nothing will break.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41785#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list