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

WordPress Trac noreply at wordpress.org
Mon Mar 30 19:02:50 UTC 2015


#31809: get_date_from_gmt returns time=zero when timezone is not set
----------------------------+-----------------------------
 Reporter:  goodevilgenius  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Formatting      |    Version:  4.1.1
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 when calling `get_date_from_gmt(null)` when the timezone is not set (i.e.,
 `get_option('timezone_string')` returns `null`), the function returns
 `Thu, 01 Jan 1970 00:00:00 +0000`.

 It should return the current time in the server's default timezone.

 On line 2283 of formatting.php, we have this line:

 {{{#!php
 return date( $format, 0 );
 }}}

 This should be replaced with:

 {{{#!php
 return date( $format );
 }}}

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


More information about the wp-trac mailing list