[wp-trac] [WordPress Trac] #46210: Add helpers for default/empty datetime value

WordPress Trac noreply at wordpress.org
Thu Feb 7 22:42:57 UTC 2019


#46210: Add helpers for default/empty datetime value
-----------------------------+------------------------------
 Reporter:  johnjamesjacoby  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Date/Time        |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |     Focuses:
-----------------------------+------------------------------

Comment (by johnjamesjacoby):

 Beware: the `NO_ZERO_DATES` MySQL mode rabbit hole is very deep.

 WordPress doesn't use null as a default value in `datetime` columns for
 legacy reasons, and I'm not suggesting we try to support it here. Mostly,
 I am just sick of typing `0000-00-00 00:00:00` in my own related code, and
 rewriting the same helpers for avoiding empty datetime values.

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


More information about the wp-trac mailing list