[wp-trac] [WordPress Trac] #18146: Add user-level & front end timezone display flexibility according to a fixed time [GMT:0]

WordPress Trac noreply at wordpress.org
Fri Feb 15 19:06:08 UTC 2019


#18146: Add user-level & front end timezone display flexibility according to a
fixed time [GMT:0]
-------------------------------+-----------------------------
 Reporter:  RanYanivHartstein  |       Owner:  swissspidy
     Type:  feature request    |      Status:  assigned
 Priority:  normal             |   Milestone:  Future Release
Component:  Date/Time          |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch        |     Focuses:
-------------------------------+-----------------------------

Comment (by rianjs):

 > Where and how a datetime value gets mutated according to a user
 preference is highly nuanced.

 > There are endless examples of where a user with an account may prefer to
 see things relative not only to their current time zone, but even in their
 preferred date and time formats. Adding timezone support is simply the
 fist step of several.

 > It is similarly, unintentionally, user-hostile & discriminatory to force
 users to adjust (or ignore) another person's date or time formatting,
 calculating 24-hour time vs. am/pm meridems , swapping months and days,
 etc...

 How a moment in time is persisted, and how its displayed are two different
 things, and when those two things are kept separate in the software
 design, they're easier to mix and match.

 For the most part, WP deals with moments in time. Those can be written
 down as UTC. A post, comment, etc. each have a moment in time when they're
 published, for example, and that moment is almost always in the past.
 There are some cases where WP has to think about moments in the future,
 but those are few and far between, and handling a case of `tzdata`
 changing what the future UTC offset rules are for a given IANA locale is
 going to be incredibly rare. (Time zones do change, but it's a relatively
 infrequent occurrence where population centers are.)

 If moments when things are published are written down in the db with UTC
 timestamps, applying an IANA time zone *view* on that UTC time for each
 user (or falling back to the browser's assertions about time zones for
 unregistered users) makes it easy to display the UTC moment as a local
 moment. Further applying a formatting string to the local time is, again,
 a view concern, specific to the user, and fairly straightforward to
 implement.

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


More information about the wp-trac mailing list