Date.parse

Discussion in 'ASP General' started by Ben, Jun 19, 2007.

  1. Ben

    Ben Guest

    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!
     
    Ben, Jun 19, 2007
    #1
    1. Advertising

  2. In microsoft.public.scripting.jscript message <1182292689.337148.23170@o
    61g2000hsh.googlegroups.com>, Tue, 19 Jun 2007 15:38:09, Ben
    <> posted:

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

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
    news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
    <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
    <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
     
    Dr J R Stockton, Jun 20, 2007
    #2
    1. Advertising

  3. Ben

    asdf Guest

    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.





    "Dave Anderson" <> wrote in message
    news:...
    > "Ben" wrote:
    >> Can anyone explain why this,
    >> Date.parse("Jan 1, 1970")
    >> equals this,
    >> 18000000
    >> ?

    >
    > Your time zone accounts for the difference. Compare:
    >
    > Date.parse("Jan 1, 1970 EST") // 18000000
    > Date.parse("Jan 1, 1970 GMT") // 0
    >
    >
    >
    > --
    > Dave Anderson
    >
    > Unsolicited commercial email will be read at a cost of $500 per message.
    > Use of this email address implies consent to these terms.
     
    asdf, Jul 7, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    631
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,327
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    548
    Pete Becker
    Nov 8, 2003
  4. Jacob Gorban
    Replies:
    12
    Views:
    259
    Reid Thompson
    Nov 2, 2009
  5. Matteo
    Replies:
    4
    Views:
    174
    Dr John Stockton
    Jun 15, 2004
Loading...

Share This Page