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


Groups > comp.soft-sys.math.mathematica > #8053 > unrolled thread

Re: Daylight savings time in DatePlus.

Started by"Hans Michel" <hmichel@cox.net>
First post2012-01-21 10:18 +0000
Last post2012-01-21 10:18 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Daylight savings time in DatePlus. "Hans Michel" <hmichel@cox.net> - 2012-01-21 10:18 +0000

#8053 — Re: Daylight savings time in DatePlus.

From"Hans Michel" <hmichel@cox.net>
Date2012-01-21 10:18 +0000
SubjectRe: Daylight savings time in DatePlus.
Message-ID<jfe3do$9ub$1@smc.vnet.net>
Craig:

I would use UTC date and time in ISO 8601 format timezone set to 0 in all
timestamping operations given a choice. But we don't know where or how your
data was collected. Here are the ideas use AbsoluteTime with TimeZone
options, DateString can also make use of the time zone offsets which is good
for plot labels to have the same ticks.
For example:

AbsoluteTime[{2010, 1, 1, 0, 0, 0}, TimeZone -> -5] - 
 AbsoluteTime[{2010, 1, 1, 0, 0, 0}]

http://reference.wolfram.com/mathematica/ref/AbsoluteTime.html

AbsoluteTime returns number of seconds since {1900,1,1,0,0,0} there was no
UTC back then so it is in GMT. GMT and UTC can be equivalent but they are
not the same.

http://tycho.usno.navy.mil/zones.html

British Summer Time began Sunday, March 28, 2010 01:00 GMT, and ended
Sunday, October 31, 2010 01:00 GMT.
http://www.daylightsavingtime.co.uk/

Daylight Saving Time (United States) began Sunday, March 14, 2010, 2:00am,
and ended Sunday, November 7, 2010, 2:00am.
Except Arizona and Hawaii. Move your clocks ahead 1 hour in spring and back
1 hour in fall ("Spring forward, fall back").

http://www.nist.gov/pml/div688/faq.cfm

So if Sunday, March 14, 2010, 2:00am TimeZone is one number Sunday, November
7, 2010, 2:00am TimeZone is another number.

Filter both sets of timestamps to AbsouteTime using TimeZone and for display
back to approximate local time use current timezone. 

Hans
-----Original Message-----
From: W Craig Carter [mailto:ccarter@mit.edu] 
Sent: Friday, January 20, 2012 12:52 AM
Subject: Daylight savings time in DatePlus. 

Hello,
I need to account for daylight savings time in list of data representing 
each hour in year 2010. I would like to correlate that with other data 
taken at 15 second intervals in the same year.

In 2010 daylight savings time in the US began on 14 March 2AM.

DateDifference[{2010, 1, 1, 1}, {2010, 3, 14, 1}, "Hour"] (*1728 hours after
beginning of year*)

DateString /@ (DatePlus[{2010, 1, 1, 1}, {#, "Hour"}] & /@Range[1728, 1738])

(*doesn't reflect that 3AM should follow 1AM*)


In hindsight, this is not surprising because daylight savings time 
shifts are not standardized intranationally or internationally.  I don't 
see any clever work-around. Does anyone else?

Craig



W Craig Carter
Professor of Materials Science, MIT




[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web