WordPress.org

Making WordPress.org

Opened 8 weeks ago

Last modified 8 weeks ago

#5466 new defect

Change the way time is displayed when it has been converted to local time zone

Reported by: estelaris Owned by:
Milestone: Priority: normal
Component: WordPress.org Site Keywords:
Cc:

Description

Time zones in Europe and Asia, are marked as UTC, UTC +1, UTC +2, etc or GMT +1, GMT +2, etc.

In WP.org, the time displays as TIME TIMEZONE, as an example: 07:00 PM GMT+2, which could mean one of the two things:

  1. Is it 7:00 PM in the GMT time zone, then add 2 hours to the user's current time, or
  2. Is it 7:00 PM in my current, converted time zone.

Is there a way to display the time in a form that is not ambiguous, like 7:00 PM (GMT+2) so the user understands that the time has already been converted to their local time zone?

Attachments (2)

time displayed with time zone.png (148.5 KB) - added by estelaris 8 weeks ago.
@Otto42 in most blog pages in core, but here is one specific that can illustrate the issue: https://make.wordpress.org/core/2020/09/01/bug-scrub-schedule-for-5-6/. The issue shows both in the sidebar and the blog content.
times.png (68.8 KB) - added by Otto42 8 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 @Otto42
8 weeks ago

Where are you seeing these times being displayed in this manner?

@estelaris
8 weeks ago

@Otto42 in most blog pages in core, but here is one specific that can illustrate the issue: https://make.wordpress.org/core/2020/09/01/bug-scrub-schedule-for-5-6/. The issue shows both in the sidebar and the blog content.

#2 @Otto42
8 weeks ago

Yeah, that's not what everybody sees.

Those time displays are actually created by a bit of javascript code which has your browser convert them to your own local time.

If you examine the attachment I added, you'll note that it says CDT for me. And the times are in my local time.

The timezone it is displaying actually comes from your browser settings, not from the server.

@Otto42
8 weeks ago

#3 @Otto42
8 weeks ago

Would simply adding parenths around the timezone make more sense for all cases? Because that's not a standard format I've ever seen before, the standard is usually simply to specify the timezone after the time. But then most timezones are named, so seeing GMT+2 is not the usual case.

Edit: Note that with the current implementation, there's no easy way to do this. The time is formatted by the browser using the Date.prototype.toLocaleTimeString() function.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString

All that the w.org code is doing is to figure out the actual time, pass it along to that function, and then tell the browser to display it in the browser's own default language. The formatting and such is thus entirely browser dependent.

Last edited 8 weeks ago by Otto42 (previous) (diff)
Note: See TracTickets for help on using tickets.