By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

Ignore Daylight Savings in Date Calculations?

P: n/a
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?
Sep 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Joe Jax said the following on 9/19/2005 11:35 AM:
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?


Yes. Do your calculations using UTC or GMT.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 19 '05 #2

P: n/a
JRS: In article <fV*******************@tornado.ohiordc.rr.com>, dated
Mon, 19 Sep 2005 15:35:39, seen in news:comp.lang.javascript, Joe Jax
<jj@nowhere.com> posted :
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?


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.
Sep 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.