Re: IE 6 jscript getTime() error???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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)
.



Relevant Pages

  • Re: Problems with files greater than 2 GB on Suse 10 Retail
    ... other google clowns in my killfile. ... People use Usenet because they get more, and better, answers to their ... It won't bother me, because you'll be in ... "Lost? ...
    (alt.os.linux.suse)
  • Re: Fraudsters could be cheating disabled
    ... Although perhaps I should have claimed Quirk's Exception! ... and the Nazis into a long-running and argumentative usenet thread is deemed ... to have lost the argument. ... the dot wanderer at tesco dot net ...
    (uk.people.disability)
  • Re: Whoops, there goes that data
    ... Strange that they weren't able to restore the lost data... ... The only downside when retrieving lost data is ... "Usenet Filters - Learn to shut yourself the fuck up!" ...
    (alt.2600)
  • Re: Case dismissed?
    ... Enjoy your day in court Paul, and go down in Usenet history ... > By and large this is still true, as a keen motorcyclist the odd asshole ... not have put your personal life & livelihood on the line for a lost cause, ...
    (uk.local.southwest)
  • Re: Basic navigational skills badly missing
    ... resulting in the MRT call out. ... The BBC - ... >"The men became lost as they descended Ben Macdui" ... >When all else fails blame the weather. ...
    (uk.rec.walking)