In comp.lang.javas cript message <11************ *********@30g20 00cwc.goog
legroups.com>, Thu, 8 Mar 2007 13:53:45,
sc************* @gmail.com
posted:
>On Mar 8, 3:05 pm, vunet...@gmail. com wrote:
How can I convert UTC time such as 1173451235415 to a local time I can
read? Thank you
gmtDate=new Date(UTC Date)
>thank you, my problem was that 1173451235415 could not be a string.
even a string should work-
Date("11734512 35415")
>when i parseInt(someti me), it works well. thank you very much.
or +sometime
e.g
Date(+somtim e)
Don't post untested code; it shows that you overestimate your ability.
In IE6 at least, Date(X) ignores the value of X. See ISO 16262
sections 15.9.2 & 15.9.2.1 which seem not to agree; ECMA-262 likewise.
Calling new Date(1173451235 415) does no conversion; the digits are
converted to an IEEE Double (type Number) outside the call, and that
value is copied into the newly-created Date Object.
The default conversion from Date Object to String, and some of the
explicit Methods, convert to unspecified string forms of local
date/time.
While your answer seems to have satisfied vunet's immediate need, it
will not have taught him much.
It's a good idea to read the newsgroup and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 IE 6
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.