Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34215
| Path | csiph.com!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.38.237.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Measuring time |
| Date | Thu, 26 Oct 2017 19:21 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 116 |
| Message-ID | <2074425.ElGaqSPkdT@PointedEars.de> (permalink) |
| References | <osa2ld$6t0$1@gioia.aioe.org> <2345791.k3LOHGUjKi@PointedEars.de> <edfd27c0-30b9-40e6-b265-f7da17d99a0d@googlegroups.com> <2876676.AJdgDx1Vlc@PointedEars.de> <8f442f26-987b-4482-bf5f-775856a0a3b8@googlegroups.com> <5883795.4vTCxPXJkl@PointedEars.de> <7b7114cd-8e1a-49f3-b69f-9a23e95d280c@googlegroups.com> <4491754.69AeqWupk3@PointedEars.de> <f89fc038-a9ed-4df5-9d41-3a0b096f944f@googlegroups.com> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| Injection-Info | gwaiyur.mb-net.net; posting-host="38.237.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch:178.197.237.38"; logging-data="13386"; 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+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v |
| Cancel-Lock | sha1:ZEWi8IticAxOXCpsukbeByowV3M= |
| X-User-ID | U2FsdGVkX18n9SqN0BAlVlwsS5y7yBaXsgudMq7vUtohkCZSPCNW2Q== |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== |
| Xref | csiph.com comp.lang.javascript:34215 |
Show key headers only | View raw
Dr J R Stockton wrote:
> On Tuesday, October 24, 2017 at 11:59:40 PM UTC+1, Thomas 'PointedEars'
> Lahn wrote:
>> Dr J R Stockton wrote:
>> > On Thursday, October 19, 2017 at 9:58:26 PM UTC+1, Thomas 'PointedEars'
>> > Lahn wrote:
>>
>> Attribution line, not attribution novel.
>
> OAF.
No, I do not think that the Open Access Framework has something to do with
it.
>> > > 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.
>
> It is, and it was well known long ago to many of us here,
It turns out that the MakeDay() algorithm was never the reason, but the Date
constructor itself: From
<http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,
%201st%20edition,%20June%201997.pdf>
to
,-<http://www.ecma-international.org/ecma-262/8.0/#sec-date-year-month-date-hours-minutes-seconds-ms>
|
| […]
| h. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, then let yr be
| 1900+ToInteger(y); otherwise, let yr be y.
> so why did you write "it had just occurred to me",
That follows from my description.
> which implies surprise?
More like coincidence in this case.
> Perhaps you meant "I had just remembered".
No.
>> > IIRC, new Date(Y, 0, N) fails for years 0 to 99;
>
> <<< Of course, that is not a true failure, as can be seen
> by searching the Standard for the string "1900". It is
> just an inanity of the Originators, as is getYear not
> doing what getFullYear was later added to do.
ACK.
>> 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)
>
> It is easier to use var d = new Date(100, -1200, 1) or some
> variant thereof, such as var d = new Date(-100, 1200, 1) ;
> one can indeed use var d = new Date(400, 0, 1-400*365.2425) .
> And easier still : var d = new Date(-1, 12, 1) .
Easier maybe, but not as reliable, and certainly harder to maintain.
A wrapper constructor that calls setFullYear() if necessary appears to be
the better approach.
>> <https://en.wikipedia.org/wiki/1_BC> 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:
^^^^
> But, according to my relevant IoP diary, 1999-01-01 was a Friday.
Yes; this was a typo, as you can see if you consider the source code.
> The obvious handy authority for the secular proleptic Gregorian year
> zero is the civil calendar for years 2000 += n*28, for |n|<4. That
> IoP diary says that the year 2000 was Saturday to Sunday; therefore
> 2001-001 = 2001-W01-1 (sic) was a Monday, as was fairly well
> known at the time.
I do not follow.
--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Random numbers emf <emfril@gmail.com> - 2017-10-19 07:35 -0400
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-19 05:03 -0700
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 21:06 +0200
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-19 12:10 -0700
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 22:04 +0200
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-19 13:41 -0700
Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-19 22:58 +0200
Re: Measuring time (was: Random numbers) Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-24 13:05 -0700
Re: Measuring time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-25 00:59 +0200
Re: Measuring time Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-25 13:36 -0700
Re: Measuring time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-26 19:21 +0200
Re: Measuring time (was: Random numbers) Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2017-10-26 10:45 +0200
Re: Measuring time (was: Random numbers) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 12:27 +0200
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-26 19:04 +0200
Re: Measuring time (was: Random numbers) Hans-Georg Michna <hans-georg@michna.com> - 2017-10-28 11:05 +0200
Re: Measuring time (was: Random numbers) Dr J R Stockton <J.R.Stockton@physics.org> - 2017-10-29 03:03 -0700
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-29 17:56 +0100
Re: Measuring time (was: Random numbers) dr.j.r.stockton@gmail.com - 2017-10-29 15:12 -0700
Re: Measuring time Sam E <why.should.this@be.email.invalid> - 2017-10-29 17:35 -0500
Re: Measuring time (was: Random numbers) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-30 13:00 +0100
Re: Measuring time (was: Random numbers) Tim Slattery <tim@risingdove.com> - 2017-10-26 14:13 -0400
Re: Random numbers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-10-19 22:21 +0100
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-19 22:25 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-20 21:52 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-20 22:40 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-21 12:40 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-21 12:57 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-21 12:59 -0700
Re: Random numbers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-22 16:37 -0700
Re: Random numbers Julio Di Egidio <julio@diegidio.name> - 2017-10-22 17:23 -0700
Re: Random numbers emf <emfril@gmail.com> - 2017-10-20 20:32 -0400
Re: Random numbers "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-21 09:47 -0700
Re: Random numbers emf <emfril@gmail.com> - 2017-10-22 14:55 -0400
Re: Random numbers emf <emfril@gmail.com> - 2017-10-27 22:23 -0400
Re: Random numbers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-28 18:54 +0200
csiph-web