In comp.lang.javascript message <
[email protected]>
Dr J R Stockton wrote on 27 sep 2009 in comp.lang.javascript:
I am not an Opera fan since my Windows Mobile was put aside for the much
more stable Andriod OS, so I am not current on all the modus operandi
inside number 10.
The whole idea, however of Javascript using the local time as a default,
and the UTC as a special case with seperate functions is asking for
trouble.
That is such a good idea that I did it some while ago. See
<URL:
http://www.merlyn.demon.co.uk/js-dobj2.htm>. It has no known bugs;
but I'd not be altogether surprised to hear of something to fix in the
code.
Apart from FFF support, Julian Calendar & Orthodox Easter, have I left
anything out?
Why not start with:
new Date() or
new Date(aDate) or
new Date(aDate,'local') or
new Date(aDate,+1) // West European summertime
and
new Date(,'UTC') or
new Date(aDate,'UTC') or
new Date(aDate,0)
and expanding the date object from there?
I think it better to have a "global" DATE2.GMT, default false.
Then (for example) setMonth uses GMT or Local Civil Time (LCT)
accordingly. That would be easy for browsers to implement; existing
setMonth must necessarily consult the system to find the Winter Offset &
Summer Time situation, and there would just be a preliminary test of
DATE2.GMT to use constant zero offset if true. Pure GMT work would be
insignificantly slower, because of that test.
String "GMT" is better than "UTC" as JavaScript has no Leap Seconds;
"UT" would be better, but is too like "UTC".
Adding extra arguments leads to the possibility of forgetting to do so.
Almost any code not using "new DATE2()", or using it just for timing
intervals, should be run with DATE2.GMT set to true, for speed.
This could be prototyped by us, allowing for backward compatibility,
till the powers that be see the light and incorporate it into standards
and new Versions().
Mentioned in my <URL:
http://www.merlyn.demon.co.uk/js-262-5.htm>, which
was made known to TPTB as a response to request for comment in ECMA-262
Final Draft 5. A response has indicated that at least one relevant
person has paid it some attention; and at least one point therein has
been attended to in a later draft.
Why is the Final Draft not the last one?
I dropped source-code compatibility in favour of replacing "UTC" and
corresponding "" in method names with "X". That's trivial to learn, and
prevents unthinkingly using old Methods; but perhaps unnecessary in a
new native Object.
Bug circumvention could be incorporated as an added bonus.
Perhaps. Between 9.20 & 10, Opera introduced at least one Date Object
bug, dropping compatibility with 262-3 for compatibility with IE.
<URL:
http://www.merlyn.demon.co.uk/js-datex.htm> refers.
Try <
http://www.bbc.co.uk/programmes/b007jwdh> <G>