Re: Daylight savings time in DatePlus.
- To: mathgroup at smc.vnet.net
- Subject: [mg124482] Re: Daylight savings time in DatePlus.
- From: "Hans Michel" <hmichel at cox.net>
- Date: Sat, 21 Jan 2012 05:15:55 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201201200652.BAA18151@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 at mit.edu]
Sent: Friday, January 20, 2012 12:52 AM
To: mathgroup at smc.vnet.net
Subject: [mg124482] 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
- References:
- Daylight savings time in DatePlus.
- From: W Craig Carter <ccarter@mit.edu>
- Daylight savings time in DatePlus.