[wp-trac] [WordPress Trac] #29205: Remove manual UTC offsets that are not officially used

WordPress Trac noreply at wordpress.org
Fri Aug 15 12:23:10 UTC 2014


#29205: Remove manual UTC offsets that are not officially used
-------------------------+------------------------------
 Reporter:  nerrad       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Date/Time    |     Version:  2.9.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  administration
-------------------------+------------------------------

Comment (by nerrad):

 How I discovered this, is I needed to convert any user's UTC offset
 selections to a close equivalent timezone string.  To do this I grabbed
 the abbrarray from php's `timezone_abbreviations_list()` and I loop
 through it, grabbing the 'offset' key and comparing it with the selected
 UTC offset * 3600.  I had some error control in place if there wasn't a
 valid timezone string matching the given offset and that's where this
 surfaced.

 I've attached a dump of all the offsets that are returned via
 `timezone_abbreviations_list()` and as you'll see, there are no equivalent
 timezone strings found for -:30, +:30, -6:30, -7:30, and -8:30 (there may
 be others but those are the definite ones I've found).

 As for:

 >I have no idea if somebody would actually be using one of these, but we'd
 need to know what would happen if they were and the option were removed.

 I think to mitigate that, we'd likely have to have some sort of check to
 see if any invalid offset is saved in user db and then just bump it up to
 the closest offset matching it.

 Really tho,  I suspect this has gone unnoticed so long precisely because
 no one IS using these offsets,  why would they if they don't actually
 exist in the real world :).

 I'm willing to do a patch for this if desired... I just didn't want to do
 it until I knew it had any traction cause I've easily worked around it for
 my use case.

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


More information about the wp-trac mailing list