Re: IE 6 jscript getTime() error???
- From: "Evertjan." <exjxw.hannivoort@xxxxxxxxxxxx>
- Date: 31 Mar 2008 20:52:38 GMT
bugs wrote on 31 mrt 2008 in microsoft.public.scripting.jscript:
I've run in to a weird problem. The getTime() function for Mar 10,
2008 seem to have lost 1 hour. Please see the following results:
(new Date(2008,2,7)).getTime() 1204866000000
(new Date(2008,2,8)).getTime() 1204952400000 86400000
(new Date(2008,2,9)).getTime() 1205038800000 86400000
(new Date(2008,2,10)).getTime() 1205121600000 82800000
(new Date(2008,2,11)).getTime() 1205208000000 86400000
(new Date(2008,2,12)).getTime() 1205294400000 86400000
[Please do not post tabs on usenet]
The 3rd column is the difference between current day and yesterday.
This should be 1000x60x60x24. However Mar 10, 2008 seem to be missing
one hour. I googled but nobody mention this before. I don't have other
version of IE or other browser to test. Can anyone confirm this?
Perhaps better show your real code, I suspect you made a a mistake.
This:
<script type='text/javascript'>
t = new Date(2008,2,7).getTime()
document.write(t+'<br>')
tt = t
t = new Date(2008,2,8).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
tt = t
t = new Date(2008,2,9).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
tt = t
t = new Date(2008,2,10).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
tt = t
t = new Date(2008,2,11).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
tt = t
t = new Date(2008,2,12).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
tt = t
t = new Date(2008,2,13).getTime()
document.write(t+'<br>')
document.write(t - tt +'<br>')
</script>
gives:
1204844400000
1204930800000
86400000
1205017200000
86400000
1205103600000
86400000
1205190000000
86400000
1205276400000
86400000
1205362800000
86400000
Not at all the same numbers as you have,
due to the local to utc conversion!
The differences should be and are constant:
86400000 or 8.64e7, John Avogadro Stockton's daynumber.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.
- References:
- IE 6 jscript getTime() error???
- From: bugs
- IE 6 jscript getTime() error???
- Prev by Date: Re: IE 6 jscript getTime() error???
- Next by Date: Re: shift+click and cntrl + click in IE 7
- Previous by thread: Re: IE 6 jscript getTime() error???
- Index(es):
Relevant Pages
|