[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
date/time string manipulation, time zones, and daylight savings time
From: |
E. Joshua Rigler |
Subject: |
date/time string manipulation, time zones, and daylight savings time |
Date: |
Tue, 13 Mar 2012 17:05:25 -0600 |
I periodically run into problems with datestr.m and datevec.m when
dealing with date/time strings that span a daylight savings time
transition, and the strings specify UTC times (honestly, I should
write myself a faq, since I've rediscovered this issue multiple
times). Ultimately, this is because lower-level, built-in date/time
functions like strptime use libraries that check the TZ environmental
variable to determine whether the date/time strings they are
processing need to be adjusted for daylight savings time or not.
My work-around is to simply "putenv('TZ','')" from Octave before using
any date/time functions. Then the low-level date/time manipulation
libraries assume everything is UTC, and I get the results I expect.
However, this does not seem very elegant, and is probably not
perfectly portable. This must be a problem other
scientists/engineers/data-junkies must have faced in the past. What
was your solution?
-EJR
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- date/time string manipulation, time zones, and daylight savings time,
E. Joshua Rigler <=