JRS: In article <
[email protected]>
, dated Tue, 2 Nov 2004 21:06:12, seen in Jc
John, your critique of my response to Richard necessitates further
explanation, as you seem to have several misconceptions regarding dates
and javascript.
Please learn to quote correctly when replying, with an adequate
attribution and responses following quoted points.
Javascript DOES consider regional dependant settings, such as the
toLocaleString method of the Date object, which returns a date
converted to a string using the current locale. It is the
responsibility of the Javascript implementation to deal with the
operating system regional settings, which means programmer's CAN rely
on the regional features of javascript within a browser setting.
Do not assume that javascript always correctly implements that
responsibility. It does not.
Do not assume that the data selected by the regional settings of, for
example, Windows always actually matches the real world. It does not.
Remember also that nowadays, with portable PCs being used by naive
travellers, it is quite likely that a change of local time will in fact
be done as a clock correction rather than as a zone change; the regional
settings may well be for a different region.
Your explicit assumption that the OS is windows.
Your comment regarding milliseconds GMT
...
You do NOT want to store the time as milliseconds
...
ISTM that you should have understood what I wrote *before* responding.
Sometimes, for example when considering astronomical events, one
definitely wants an absolute date/time, independent of location. But
sometimes, for example when considering historical events, one by custom
wants a local date, for the current location.
For example, IIRC Arnie the unspellable was, IIRC, born in Europe
(Austria?), on a known (by him) date Y M D. No doubt he celebrates his
N'th birthday on Californian Y+N M D, rather than at the time, about
half a day earlier, matching the Austrian date.
On a side note, referring to GMT in technical context should be
avoided, the more precise term is UTC.
(a) The legal time in the UK is GMT.
(b) UTC has leap seconds; javascript does not. In fact very few
computers understand UTC properly. Therefore, GMT is a better
description of what is actually implemented. While computers may be
frequently corrected by reference to a UTC clock, their uncertainty in
maintaining time is generally large in comparison with the UTC/GMT
difference (at most 0.9 seconds). UT would be a better term, except
that most readers would take it as being a typo for UTC, or short for
Utah.
Perhaps you should read the newsgroup FAQ - all of it.