Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16288
| From | Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: How to construct a tomorrow? |
| Date | 2012-09-30 19:55 +0100 |
| Organization | Home |
| Message-ID | <egbfg1QhWJaQFw7O@invalid.uk.co.demon.merlyn.invalid> (permalink) |
| References | <6aae09ab-0d45-4c30-accf-909d7445c6a2@o8g2000yqm.googlegroups.com> <k401aj$jnh$1@speranza.aioe.org> <ecUo+7MM7dZQFwAQ@invalid.uk.co.demon.merlyn.invalid> <k45dmn$8j7$1@speranza.aioe.org> |
In comp.lang.javascript message <k45dmn$8j7$1@speranza.aioe.org>, Sat,
29 Sep 2012 02:00:31, Christoph Becker <cmbecker69@gmx.de> posted:
>Dr J R Stockton wrote:
>> In comp.lang.javascript message <k401aj$jnh$1@speranza.aioe.org>, Thu,
>> 27 Sep 2012 00:58:35, Christoph Becker <cmbecker69@gmx.de> posted:
>>
>>> justaguy wrote:
>>>> how do we get tomorrow based on today?
>>
>>> So a simple solution is:
>> xxxxxx naive
>>>
>>> var today = new Date();
>>> var tomorrow = new Date(today.getTime() + 86400000)
>>
>> And what happens when the interval crosses 01:00 UTC on the last Sundays
>> of March and October? (dates and times are different for chronologically
>> inconvenient locations).
>
>I *thought* a day is defined as having 86,400 seconds (cf.
><http://www.bipm.org/en/si/si_brochure/chapter4/table6.html>). If I am
>mistaken in this view, please correct me -- I'll appreciate an
>explanation or a link to one.
You had one, near enough, in my sig. The above link refers, manifestly,
to SI days. Civil days may vary from that by -1, -0.5, +0.5, +1 hours
and also +1 second and -1 second. The legal UK civil day is still, I
believe, GMT-based, so the +1/-1 second is here in principle replaced by
a rather small fraction of a second. (Then there are sidereal days,
Martian days, ... )
>If you were referring to summer time issues, AFAIK this wouldn't be
>relevant here, as the calculation is "internal", and the results
>/should/ be faithfully presented in human readable form by calling
>toLocalDateString().
AFAYK != AFAIK.
D1 = new Date("2012 Mar 24 23:30") // Sat Mar 24 2012 23:30:00
D2 = new Date(D1.getTime() + 864e5) // Mon Mar 26 2012 00:30:00
D1 = new Date("2012 Oct 28 00:30") // Sun Oct 28 2012 00:30:00
D2 = new Date(D1.getTime() + 864e5) // Sun Oct 28 2012 23:30:00
Those not testing in the British Isles may have to adjust the times
and/or the dates - especially any with the OS set for LHI.
JavaScript date work should, wherever practical, be done with the UTC
functions.
--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Website <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to construct a tomorrow? justaguy <lichunshen84@gmail.com> - 2012-09-26 14:47 -0700
Re: How to construct a tomorrow? Christoph Becker <cmbecker69@gmx.de> - 2012-09-27 00:58 +0200
Re: How to construct a tomorrow? justaguy <lichunshen84@gmail.com> - 2012-09-26 17:47 -0700
Re: How to construct a tomorrow? Gene Wirchenko <genew@ocis.net> - 2012-09-26 19:53 -0700
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-28 18:40 +0100
Re: How to construct a tomorrow? Gene Wirchenko <genew@ocis.net> - 2012-09-29 20:52 -0700
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-28 18:30 +0100
Re: How to construct a tomorrow? Christoph Becker <cmbecker69@gmx.de> - 2012-09-29 02:00 +0200
Re: How to construct a tomorrow? John G Harris <john@nospam.demon.co.uk> - 2012-09-29 10:02 +0100
Re: How to construct a tomorrow? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-30 14:29 +0200
Re: How to construct a tomorrow? Christoph Becker <cmbecker69@gmx.de> - 2012-09-30 23:24 +0200
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-30 19:55 +0100
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-27 21:32 +0100
Re: How to construct a tomorrow? Christoph Becker <cmbecker69@gmx.de> - 2012-09-28 01:03 +0200
Re: How to construct a tomorrow? Gene Wirchenko <genew@ocis.net> - 2012-09-27 16:36 -0700
Re: How to construct a tomorrow? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-28 10:37 +0200
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-29 20:39 +0100
Re: How to construct a tomorrow? Christoph Becker <cmbecker69@gmx.de> - 2012-09-30 23:37 +0200
Re: How to construct a tomorrow? Andrew Poulos <ap_prog@hotmail.com> - 2012-09-28 09:25 +1000
Re: How to construct a tomorrow? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-28 08:37 -0700
Re: How to construct a tomorrow? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-28 18:48 +0200
Re: How to construct a tomorrow? Dr J R Stockton <reply1239@merlyn.demon.co.uk.invalid> - 2012-09-29 20:40 +0100
Re: How to construct a tomorrow? Andrew Poulos <ap_prog@hotmail.com> - 2012-09-30 18:32 +1000
Re: How to construct a tomorrow? Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-09-28 23:57 +0200
Re: How to construct a tomorrow? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-30 13:49 +0200
csiph-web