Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12983

Re: +new Date("2012-03-21") and +new Date("2012/03/21") can differ by up to about 432e5

Newsgroups comp.lang.javascript
Subject Re: +new Date("2012-03-21") and +new Date("2012/03/21") can differ by up to about 432e5
From "Evertjan." <exjxw.hannivoort@interxnl.net>
References <ER$+NdFv4iaPFw2u@invalid.uk.co.demon.merlyn.invalid>
Message-ID <XnsA01EB082E8886eejj99@194.109.133.133> (permalink)
Date 2012-03-22 16:21 +0000

Show all headers | View raw


Dr J R Stockton wrote on 21 mrt 2012 in comp.lang.javascript:

> For those who had not noticed : it appears that the results from each
> line in
> 
>         +new Date("2012/01/21")         &       +new Date("2012-01-21")
> and
>         +new Date("2012/07/21")         &       +new Date("2012-07-21")
> 
> can differ by up to about 432e5, dependent on location.

About? The below shows exactly one or two hours difference overhere [CET].

<script type='text/javascript'>

// cet = gmt+1
a = new Date("2012/01/21");
b = new Date("2012-01-21");

//alert(a);
//alert(b);
alert((b-a)/(60*60*1000) + ' hour'); // 1 hour

a = new Date("2012/07/21");
b = new Date("2012-07-21");

// cet = gmt+2
//alert(a);
//alert(b);
alert((b-a)/(60*60*1000) + ' hours'); // 2 hours

</script>



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

+new Date("2012-03-21") and +new Date("2012/03/21")  can differ by up to about 432e5 Dr J R Stockton <reply1212@merlyn.demon.co.uk.not.invalid> - 2012-03-21 19:38 +0000
  Re: +new Date("2012-03-21") and +new Date("2012/03/21")  can differ by up to about 432e5 "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-22 16:21 +0000
    Re: +new Date("2012-03-21") and +new Date("2012/03/21")  can differ by up to about 432e5 Dr J R Stockton <reply1212@merlyn.demon.co.uk.not.invalid> - 2012-03-23 22:25 +0000
      Re: +new Date("2012-03-21") and +new Date("2012/03/21")  can differ by up to about 432e5 "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-24 00:09 +0000

csiph-web