[wp-trac] [WordPress Trac] #33624: date_i18n do not returns time in GMT even if GMT is set to false

WordPress Trac noreply at wordpress.org
Mon May 27 16:54:42 UTC 2019


#33624: date_i18n do not returns time in GMT even if GMT is set to false
--------------------------------------+----------------------
 Reporter:  KestutisIT                |       Owner:  (none)
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:
Component:  Date/Time                 |     Version:  4.3
 Severity:  normal                    |  Resolution:  wontfix
 Keywords:  2nd-opinion dev-feedback  |     Focuses:  ui
--------------------------------------+----------------------
Changes (by Rarst):

 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Old description:

> If I take a timestamp ''''1441018800'''' and test it on:
> http://www.epochconverter.com/
>
> I get this:
>
> {{{
> GMT: Mon, 31 Aug 2015 11:00:00 GMT
> Your time zone: Monday, August 31, 2015 2:00:00 PM GMT+3:00 DST
> }}}
>

> While, in Wordpress, the function which suppose to give me a local time
> by default, of when $GMT=FALSE, is always giving me the same GMT time
> instead, whatever I do:
>
> {{{
> date_i18n("H:i:s", 1441029600); // Same 11:00:00
> date_i18n("H:i:s", 1441029600, TRUE); // Same 11:00:00
> date_i18n("H:i:s", 1441029600, FALSE); // Same 11:00:00
> }}}
>
> In WordPress settings, I set my time zone to Europe->Vilnius, which is
> GMT+2:00 usually, and GMT+3:00 now, because of DTS.
>
> I've still not yet upgraded from 4.2.4 to 4.3, but as per bug fixes
> report I don't see that it is fixed.

New description:

 If I take a timestamp ''''1441018800'''' and test it on:
 http://www.epochconverter.com/

 I get this:

 {{{
 GMT: Mon, 31 Aug 2015 11:00:00 GMT
 Your time zone: Monday, August 31, 2015 2:00:00 PM GMT+3:00 DST
 }}}


 While, in WordPress, the function which suppose to give me a local time by
 default, of when $GMT=FALSE, is always giving me the same GMT time
 instead, whatever I do:

 {{{
 date_i18n("H:i:s", 1441029600); // Same 11:00:00
 date_i18n("H:i:s", 1441029600, TRUE); // Same 11:00:00
 date_i18n("H:i:s", 1441029600, FALSE); // Same 11:00:00
 }}}

 In WordPress settings, I set my time zone to Europe->Vilnius, which is
 GMT+2:00 usually, and GMT+3:00 now, because of DTS.

 I've still not yet upgraded from 4.2.4 to 4.3, but as per bug fixes report
 I don't see that it is fixed.

--

Comment:

 The inline documentation for `date_i18n()` had been clarified. It's
 unlikely that behavior will change though, due to backwards compatibility.

 I am planning to introduce a new `wp_date()` function, operating with real
 Unix timestamps, but in context of `date_i18n()` this isn't actionable.
 Just the way it works unfortunately.

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


More information about the wp-trac mailing list