[wp-trac] [WordPress Trac] #21653: Fix current_date() (was: Introduce current_date())

WordPress Trac noreply at wordpress.org
Tue Jan 12 11:53:03 UTC 2016


#21653: Fix current_date()
------------------------------+---------------------
 Reporter:  johnbillion       |       Owner:  nacin
     Type:  enhancement       |      Status:  closed
 Priority:  low               |   Milestone:  3.9
Component:  Date/Time         |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------

Comment (by Turn On Social):

 'timestamp' functionality appears to be wrong.

 current_time('timestamp') should always return the timestamp according to
 GMT. That's because a timestamp is defined as the number of seconds that
 have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1
 January 1970.

 Therefore, producing this offset by x number of hours for local time is
 incorrect logic. If it's 1,452,598,896 seconds since the start of Unix
 time, this does not change depending on timezone - the number of seconds
 is the same (but may instead be displayed differently depending on
 timezone).

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


More information about the wp-trac mailing list