Date.parse

B

Ben

Hi,

Can anyone explain why this,
Date.parse("Jan 1, 1970")
equals this,
18000000
?

Microsoft's documentation reports this, "
The parse method returns an integer value representing the number of
milliseconds between midnight, January 1, 1970 and the date supplied
in dateVal.
"

Would that not imply that the above value should be ZERO?

Thanks!
 
D

Dr J R Stockton

In microsoft.public.scripting.jscript message <1182292689.337148.23170@o
61g2000hsh.googlegroups.com>, Tue, 19 Jun 2007 15:38:09, Ben
Can anyone explain why this,
Date.parse("Jan 1, 1970")
equals this,
18000000
?

Microsoft's documentation reports this, "
The parse method returns an integer value representing the number of
milliseconds between midnight, January 1, 1970 and the date supplied
in dateVal.
"

Would that not imply that the above value should be ZERO?

It would, but MS documentation should not be believed infallible.

You have 18000000 ms or 18000 sec or 300 min or 5 hours.

You, apparently being in New York or thereabouts, are five hours slow on
the real time, which is of course GMT.

Their "midnight, January 1, 1970" is ambiguous, because a day has two
midnights, and also wrong, because it implies local time.

The true zero is 1970-01-01 00:00:00 UT, to which UTC & GMT are good
approximations for the purpose.

Note - Microsoft probably copied the error, rather than originating it.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 
A

asdf

There he excels.

Like anybody who thinks Cristmas is the day
the sun shines 24 hours over the his square mile.

And the rest of the word of 6 Billion will suck up
to a militant and lying minority of ess than 100 million.


Year, right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top