Path: csiph.com!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.124.236.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Measuring time Date: Wed, 25 Oct 2017 00:59:34 +0200 Organization: PointedEars Software (PES) Lines: 57 Message-ID: <4491754.69AeqWupk3@PointedEars.de> References: <2345791.k3LOHGUjKi@PointedEars.de> <2876676.AJdgDx1Vlc@PointedEars.de> <8f442f26-987b-4482-bf5f-775856a0a3b8@googlegroups.com> <5883795.4vTCxPXJkl@PointedEars.de> <7b7114cd-8e1a-49f3-b69f-9a23e95d280c@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="124.236.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch:178.197.236.124"; logging-data="11675"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. On Thursday, October 19, 2017 at 9:58:26 PM UTC+1, Thomas 'PointedEars' > Lahn wrote: Attribution line, not attribution novel. > > Apropos, it had just occurred to me (when reading that the first time > > the >> on-board cesium clocks of the GPS NTS-2 satellite were tested was on “day >> 190, 1977”) that you can obtain the date for day N of year Y using >> >> new Date(Y, 0, N) > > The likelihood of that is fairly obvious on considering > > ECMA-262-1, Jun 1997, 15.9.1.12 MakeDay(year, month, date), list entry 1 > or > ECMA-262-7, Jun 2016, 20.3.1.13 MakeDay (year, month, date), list entry 1 > or I suppose the corresponding parts of all other ECMA-262. (You are preaching to the choir.) I thought that to be obvious. > IIRC, new Date(Y, 0, N) fails for years 0 to 99; It fails for those years in V8 JavaScript 5.7.492.63 in Chromium 57.0.2987.98 on Debian/Devuan GNU+Linux in that they are considered the years 1900 to 1999 CE instead (also see below): | -> new Date(99, 0, 1) | <- Fri Jan 01 1999 00:00:00 GMT+0100 (CET) However, while “new Date(0, 0, 1)” cannot be used to produce January 1, 1 BCE according to the Proleptic Gregorian calendar, it is apparently possible to do that in another way: | -> var d = new Date(0, 0, 1); console.log(d); d.setFullYear(0); | console.log(d); | Mon Jan 01 1900 00:00:00 GMT+0100 (CET) | Sat Jan 01 0 00:00:00 GMT+0100 (CET) says that it was a Saturday indeed. > and MD is wrong for most of Year 0. That is a matter of interpretation or, if understood as specified, it does not appear to be the case in that implementation (see above). According to Wikipedia, 1999-01-01 CE *was* a Monday indeed: Please clarify, or cite evidence to support, your assumption. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.