Message from discussion silly question on Date value evaluation or comparison
Received: by 10.66.89.162 with SMTP id bp2mr351280pab.4.1349248355353;
Wed, 03 Oct 2012 00:12:35 -0700 (PDT)
Received: by 10.68.233.130 with SMTP id tw2mr1005733pbc.12.1349248355335; Wed,
03 Oct 2012 00:12:35 -0700 (PDT)
Date: Wed, 3 Oct 2012 00:12:35 -0700 (PDT)
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=184.108.40.206;
Subject: Re: silly question on Date value evaluation or comparison
From: RobG <rg...@iinet.net.au>
Injection-Date: Wed, 03 Oct 2012 07:12:35 +0000
Content-Type: text/plain; charset=ISO-8859-1
On Friday, 28 September 2012 06:27:56 UTC+10, Dr J R Stockton wrote:
> NEVER use new Date() except for the measurement of intervals of time.
var d =3D new Date(2012,9,3)=20
are entirely consistent in every browser, I see no need to use any other me=
thod to create a date object.
> Use instead new Date(0), which gives consistent results and ought to be
If the requirement is to create a date object for 1970-01-01T00:00:00Z, the=
n you might be correct (even ignoring the obvious "faster than what?"). But=
that is likely an infrequent scenario.
Usually a date object is required to be set to a specific value other than =
the epoch, so what is the benefit to creating the object then setting its v=
alue (requireing at least one and maybe two further calls) over creating th=
e object and setting its value in one call?