Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Daylight savings time in DatePlus.
Replies: 4   Last Post: Jan 23, 2012 2:58 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
hmichel@cox.net

Posts: 122
Registered: 1/29/05
Re: Daylight savings time in DatePlus.
Posted: Jan 21, 2012 5:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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








Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.