[wp-trac] [WordPress Trac] #31809: get_date_from_gmt returns time=zero when timezone is not set

WordPress Trac noreply at wordpress.org
Tue Jun 26 11:31:36 UTC 2018


#31809: get_date_from_gmt returns time=zero when timezone is not set
-------------------------------+------------------------------
 Reporter:  goodevilgenius     |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Date/Time          |     Version:  3.6
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by Rarst):

 * keywords:   => reporter-feedback


Comment:

 I am hesitant about issue as reported. The function is clearly documented
 to accept non-nullable string in `Y-m-d H:i:s` format. Passing it `null`
 does not seem to be either explicitly or implicitly meaningful.

 Returning current date is a case for invalid input, which ''is'' confusing
 as for me, but that's how it is written as of right now. I do not see how
 returning ''current'' time ''for invalid input'' is especially more
 meaningful or desired. It’s an error case. If anything it should probably
 fail altogether on it, but backwards compatibility.

 What are the good reasons here to change behavior in such way?

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


More information about the wp-trac mailing list