The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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


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}]

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.

British Summer Time began Sunday, March 28, 2010 01:00 GMT, and ended
Sunday, October 31, 2010 01:00 GMT.

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").

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.

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

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?


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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.