[wp-trac] [WordPress Trac] #24730: Introduce a timezone-retrieval method

WordPress Trac noreply at wordpress.org
Mon Mar 12 15:20:17 UTC 2018


#24730: Introduce a timezone-retrieval method
-------------------------+------------------------------
 Reporter:  rmccue       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Date/Time    |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by Rarst):

 I am against using `Etc/` time zones, they are not meant or guaranteed for
 normal operation in modern PHP code.

 PHP can simply instantiate generic time zones from +00:00 format now, but
 it requires PHP version 5.5 which isn't available to WP core. Frankly I
 would just do that anyway as progressive enhancement, but that hadn't been
 an accepted practice in core dev.

 Anyone who needs to deal with that in sane fashion should just do that in
 their own code, in my opinion. I implemented this in my WpDateTime lib
 https://github.com/Rarst/wpdatetime/blob/master/php/WpDateTimeZone.php#L23-L26

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


More information about the wp-trac mailing list