Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8109
| From | W Craig Carter <ccarter@mit.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Daylight savings time in DatePlus. |
| Date | 2012-01-23 07:58 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jfj3uk$7c2$1@smc.vnet.net> (permalink) |
| References | <201201200652.BAA18151@smc.vnet.net> <000001ccd7f1$932b2430$b9816c90$@net> |
Thank you Hans,
Very nice.
However, it seems that this can't be generalized without direct input of
the daylight savings time shifts for each region where the data is
taken.
I suppose there may be case for curated data in this case. Although I
don't imagine that it would have a large audience. Astronomical data
comes to mind as one possible place where curated data and methods would
be useful---there is a current debate about adding a leap second.
In any case, many thanks for your time and effort, Craig
W Craig Carter
Professor of Materials Science, MIT
On Jan 20, 2012, at Fri, Jan 20, 12 ---11:03 PM, Hans Michel wrote:
> Craig:
>
> Working with just your example, using time zones
>
> Map[Function[
> DateString[ #1, If[Last[#1] < 2, TimeZone -> -6, TimeZone -> -5]]],
> Map[Function[DatePlus[{2010, 1, 1, 1}, {#1, "Hour"}]],
> Range[1728, 1738]]]
>
> {Sun 14 Mar 2010 01:00:00,Sun 14 Mar 2010 03:00:00,Sun 14 Mar 2010
> 04:00:00,Sun 14 Mar 2010 05:00:00,Sun 14 Mar 2010 06:00:00,Sun 14 Mar 2010
> 07:00:00,Sun 14 Mar 2010 08:00:00,Sun 14 Mar 2010 09:00:00,Sun 14 Mar 2010
> 10:00:00,Sun 14 Mar 2010 11:00:00,Sun 14 Mar 2010 12:00:00}
>
> Hans
>
> -----Original Message-----
> From: W Craig Carter [mailto:ccarter@mit.edu]
> Sent: Friday, January 20, 2012 12:52 AM
> To: mathgroup@smc.vnet.net
> 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
>
>
>
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Daylight savings time in DatePlus. W Craig Carter <ccarter@mit.edu> - 2012-01-23 07:58 +0000
csiph-web