In comp.lang.javascript message <
[email protected]
glegroups.com>, Mon, 21 May 2007 09:02:37, (e-mail address removed) posted:
What is the best method to convert milliseconds (after midnight
January 1, 1970 GMT) to formatted time
Conventionally, midnight is the end of the day. You mean 1970-01-01
00:00:00 GMT.
example:
972798180000 ==> 10/18/2000 14:08:11
That's not a sensible format for the Internet. The average American
will want 12-hour clock time, and the rest of the world won't want FFF
date field order. Convert it to YYYY-MM-DD hh:mm:ss, which is
comprehensible and unambiguous everywhere.
From that number, I get 20000-10-29 05:43:00. Your value is clearly
wrong, as an even multiple of 10 seconds from 1970.0 should give an even
multiple of 10 seconds in hh:mm:ss notation.
Then, of course, you must add UTC, GMT, or Z; or convert to local civil
time. The latter is only easy if there was no significant change in the
local Summer Time rules between the date/time in question and the
present moment, except possibly with a combination of Vista and a non-
compliant Javascript implementation.
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.