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


Groups > comp.lang.javascript > #19548

Re: How do I add new currentTime to an array

From Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: How do I add new currentTime to an array
Date 2013-04-30 22:31 +0100
Organization Home
Message-ID <q2UMG7RggDgRFwIL@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <klm0vg$545$1@dont-email.me>

Show all headers | View raw


In comp.lang.javascript message <klm0vg$545$1@dont-email.me>, Mon, 29
Apr 2013 16:47:17, Tony <tony.johansson@inport.com> posted:

>           case "Interval.RdoHour":
>               currentTime.setHours(currentTime.getHours() - 1);
>               break;

That code might well give an unexpected result in one particular hour in
Spring, when one hour of LCT is omitted, and in the Autumn, when one is
duplicated.  Worse might happen if your OS was set for LHI.

If you want always to go back by one SI hour, use of setTime should be
more efficient.

The newsgroup should like to know what source you are attempting to
learn JavaScript from; it should evidently be avoided.

-- 
 (c) John Stockton, nr London, UK.   E-mail, see Home Page.    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 | Find similar | Unroll thread


Thread

How do I add new currentTime to an array "Tony" <tony.johansson@inport.com> - 2013-04-29 16:47 +0200
  Re: How do I add new currentTime to an array "Tony" <tony.johansson@inport.com> - 2013-04-29 16:53 +0200
  Re: How do I add new currentTime to an array Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-04-30 22:31 +0100

csiph-web