[R-SIG-Finance] R Bloomberg for intraday prices

Jeffrey Ryan jeff.a.ryan at gmail.com
Thu Apr 5 21:58:56 CEST 2012


Try

> strptime(t, format="%Y-%m-%dT%H:%M:%S", tz="UTC")  # note tz=  <<<<<<<<<

[1] "2011-09-19 13:30:00 UTC"

Then

> xts(1, strptime(t, format="%Y-%m-%dT%H:%M:%S", tz="UTC"),
>tzone="America/Chicago")
                    [,1]
2011-09-19 08:30:00    1


> xts(1, strptime(t, format="%Y-%m-%dT%H:%M:%S", tz="UTC"),
>tzone="America/New_York")
                    [,1]
2011-09-19 09:30:00    1
Warning message:
timezone of object (America/New_York) is different than current timezone
(America/Chicago).



Which looks right-ish to me.

You can store it in whatever TZ you want, the warning is just telling you
that something is different and you should be aware.  Probably need to
have a flag to disable that - or only show once...

HTH
Jeff


On 4/5/12 2:29 PM, "algotr8der" <algotr8der at gmail.com> wrote:

>%Y-%m-%dT%H:%M:%S"



More information about the R-SIG-Finance mailing list