Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32989

Re: Is Date.prototoype.toString always en-us?

From Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: Is Date.prototoype.toString always en-us?
Date 2017-04-10 21:16 +0100
Organization Home
Message-ID <GLWoXCSeg+6YFwqT@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <ef8a2a84-de5e-4e9a-89fc-3144b262150c@googlegroups.com>

Show all headers | View raw


In comp.lang.javascript message <ef8a2a84-de5e-4e9a-89fc-3144b262150c@go
oglegroups.com>, Thu, 6 Apr 2017 16:17:29, RobG <rgqld@iinet.net.au>
posted:

>In the MDN documentation for *Date.prototype.toString*[1] is the claim that:
>
>> "The toString() method always returns a string representation of the
>>date in American English."

That ">>" statement is sloppily wrong, since toString returns both date
and time; and it is ambiguous, at least because (for example) currently
a New York resident might expect to see, in respect of the offset-from-
GMT indication, nothing or ET or EDT or maybe -0400.


>Noting that the documentation is primarily for Mozilla browsers, can
>someone confirm that in, say, Firefox, that Date.prototype.toString
>returns a string in US English, regardless of the default language of
>the host system?

If you want to know the answer as a coder, then you should avoid using,
as far as it is possible, any part of a standard or other document which
has the least taint of relevant ambiguity.  In JavaScript, it seems
reasonable to trust getFullYear ... getMilliseconds in local and UTC
versions (but those are not entirely right in at lease the final version
of Windows Safari; and, as I wrote recently here, in Windows Command
Prompt CScript JScript), and it is easy enough to use those functions to
produce ISO 8601 date/time strings, which should be understood
everywhere that uses the Gregorian Calendar.

Those who use YYYY-DD-MM *deserve* to suffer.  If you disagree, use
YYYY-Month-DD or YYYY-Mon-DD.  To be unambiguously obscure, use YYYY-i-
01 to YYYY-xii-31 - Unicode has individual characters for i to xii and
for I to XII.


>Also, whether this statement is true for other browsers where the
>default language is other than English?

Note that the default language of the authoring and reading systems are
not necessarily the same and neither is necessarily the language of the
main text of a document.  I know a student (non-UK EU by nationality),
whose own computer system is set to some sort of English, who can only
communicate with his maternal grandmother in Obscure Foreign, but any
computing equipment she might see may well be set to Another EU.  And,
RobG, a neighbour speaks your language.

-- 
 (c) John Stockton, Surrey, UK.  ¬@merlyn.demon.co.uk   Turnpike v6.05   MIME.
 Merlyn Web Site <                       > - FAQish topics, acronyms, & links.



---
This email has been checked for viruses by AVG.
http://www.avg.com

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is Date.prototoype.toString always en-us? RobG <rgqld@iinet.net.au> - 2017-04-06 16:17 -0700
  Re: Is Date.prototoype.toString always en-us? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-07 13:35 +0200
  Re: Is Date.prototoype.toString always en-us? RobG <rgqld@iinet.net.au> - 2017-04-08 08:47 +1000
    Re: Is Date.prototoype.toString always en-us? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-08 20:13 +0200
      Re: Is Date.prototoype.toString always en-us? John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-09 11:58 +0100
        Re: Is Date.prototoype.toString always en-us? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-09 15:54 +0200
          Re: Is Date.prototoype.toString always en-us? Luuk <luuk@invalid.lan> - 2017-04-09 16:02 +0200
          Re: Is Date.prototoype.toString always en-us? John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-09 16:51 +0100
            Re: Is Date.prototoype.toString always en-us? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-09 18:09 +0200
              Re: Is Date.prototoype.toString always en-us? John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-10 10:34 +0100
                Re: Is Date.prototoype.toString always en-us? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-11 06:26 +0200
                Re: Is Date.prototoype.toString always en-us? John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-11 18:38 +0100
      Re: Is Date.prototoype.toString always en-us? RobG <rgqld@iinet.net.au> - 2017-04-14 15:57 +1000
      Re: Is Date.prototoype.toString always en-us? RobG <rgqld@iinet.net.au> - 2017-04-14 16:45 +1000
  Re: Is Date.prototoype.toString always en-us? Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-04-10 21:16 +0100
    Re: Is Date.prototoype.toString always en-us? Julio Di Egidio <julio@diegidio.name> - 2017-04-10 19:15 -0700

csiph-web