[R-SIG-Finance] Problems extracting xts data in my own time zone

Jeff Ryan jeff.a.ryan at gmail.com
Wed Nov 12 00:04:20 CET 2008


On Tue, Nov 11, 2008 at 4:08 PM, Mark V <mvyver at gmail.com> wrote:
> Hi,
> In case anyone is reconsidering time zone behavior....

User or package developers?

> In dealing with data from different timezones I eventually came to
> convert all data to GMT.
> I now also use GMT in all my code (mkt open, close).
> This may be considered a corner case by some, but I'd argue that
> increasing globalization means such uses cases could become common.
> Furthermore, many (most?) users will be in TZ (i.e. have a system TZ)
> different to the data TZ (whether it is converted to GMT or not).
> Consequently, even if altering the default from GMT, please consider
> keeping the data's time zone as the default behavior.
>

The central issue is consistency.  It is practically (pragmatically!)
impossible to insure the formatting/conversion across different
implementations (OS/servers/patched/unpatched/TZ set/TZ reside/TZ of
data/political whims...).

You may or may not be able to get the results you want/expect some of
the time, but I suspect you will not ever be able to get the results
you expect all of the time.  For my own personal taste, I prefer fewer
surprises over more.

All that said, a solution that is both reliable and portable, would of
course be the ideal.

I for one am not holding my breath.  A quick glance through the proper
source directories in any OS database will give a very instructive
view as to the scope of the problem.

Sys.setenv(TZ="GMT") makes life a bit less interesting no doubt, but
it makes for very reliable results.  Which can always be adjusted
later for presentation effect with very simple math.

For enjoyment (and your next 900 hours of reading):
http://www.twinsun.com/tz/tz-link.htm

Jeff
-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list