Closed Bug 1289219 Opened 8 years ago Closed 8 years ago

Date::toString() methods omits DST/Timezone Information

Categories

(Core :: JavaScript: Standard Library, defect)

47 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1156728

People

(Reporter: michael.ebert, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36

Steps to reproduce:

1. Run new Date().toString() in Console on Windows 10 (German)


Actual results:

"Mon Jul 25 2016 22:10:56 GMT+0200"


Expected results:

"Mon Jul 25 2016 22:11:10 GMT+0200 (Mitteleuropäische Sommerzeit)"
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Not reproducible on macOS
(In reply to Michael Ebert from comment #1)
> Not reproducible on macOS

Version; 10.9.5
The return value of that function on a valid date is supposed to be "an implementation-dependent String value that represents tv as a date and time in the current time zone using a convenient, human-readable form", so our current behavior is spec-compliant.  There's no requirement that string forms be the same across OSes, either.

So technically this isn't a bug.  But we could consider making the change anyway, as a nicety.  I'm somewhat doubtful it's worth it -- if you need precise formatting, you shouldn't be using an underspecified toString function -- but it's not wholly implausible.
Okay, thanks for the explaination.

I am going to use the LocaleDateFormat and the current set language in order to get the timezone name.
This issue is similar to bug 1069979, the internal date_format() function doesn't accept the "ä" in "Mitteleuropäische" [1]. 

[1] http://hg.mozilla.org/mozilla-central/file/b3ec8a3373e8/js/src/jsdate.cpp#l2636
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.