Connecting Tech Pros Worldwide Help | Site Map

Ignore Daylight Savings in Date Calculations?

Joe Jax
Guest
 
Posts: n/a
#1: Sep 19 '05
I have some date calculations that add a time span to a date. The problem
is, when I add a time span that is a whole number of days to a date, the
result can be +/- 1 hour due to daylight savings. Is there anyway to disable
this?


Randy Webb
Guest
 
Posts: n/a
#2: Sep 19 '05

re: Ignore Daylight Savings in Date Calculations?


Joe Jax said the following on 9/19/2005 11:35 AM:
[color=blue]
> I have some date calculations that add a time span to a date. The problem
> is, when I add a time span that is a whole number of days to a date, the
> result can be +/- 1 hour due to daylight savings. Is there anyway to disable
> this?[/color]

Yes. Do your calculations using UTC or GMT.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Dr John Stockton
Guest
 
Posts: n/a
#3: Sep 19 '05

re: Ignore Daylight Savings in Date Calculations?


JRS: In article <fVAXe.14140$ib1.10960@tornado.ohiordc.rr.com>, dated
Mon, 19 Sep 2005 15:35:39, seen in news:comp.lang.javascript, Joe Jax
<jj@nowhere.com> posted :[color=blue]
>I have some date calculations that add a time span to a date. The problem
>is, when I add a time span that is a whole number of days to a date, the
>result can be +/- 1 hour due to daylight savings. Is there anyway to disable
>this?[/color]

Move to China - or Hawaii.

Read the FAQ; see below.

Use the UTC methods.

Use Math.round().

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Closed Thread