I got the DST correction to work - but got a strange warning (I'm in
Chicago):


> Sys.timezone()[1] "CDT"> as.POSIXct(floor(data[,"Date"][1:6]*86400),origin=ISOdatetime(1899,12,30,0,0,0,tz="CDT"))[1] "2011-08-01 08:35:00 GMT" "2011-08-01 08:39:59 GMT" "2011-08-01 08:44:59 GMT" "2011-08-01 08:50:00 GMT" "2011-08-01 08:55:00 GMT"
[6] "2011-08-01 09:00:00 GMT"Warning messages:1: In strptime(x,
"%Y-%m-%d-%H-%M-%OS", tz = tz) : unknown timezone 'CDT'2: In
as.POSIXct.POSIXlt(strptime(x, "%Y-%m-%d-%H-%M-%OS", tz = tz),  :
  unknown timezone 'CDT'3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'CDT'



---------- Forwarded message ----------
From: John Kerpel <john.kerpel@gmail.com>
Date: Mon, Sep 26, 2011 at 4:13 PM
Subject: Date conversion using POSIXct
To: r-sig-finance@r-project.org


I'm converting some Bloomberg time codes on a 5 minute interval.  I'm using
the following:


> head(data)      Date    OPEN    HIGH     LOW LAST_PRICE
1 40756.36 22.2825 22.3320 22.1834    22.2131
2 40756.36 22.2131 22.2627 22.1636    22.2230
3 40756.36 22.2181 22.2329 22.1141    22.1537
4 40756.37 22.1587 22.1834 22.0844    22.0934
5 40756.37 22.0844 22.1141 22.0052    22.0151
6 40756.38 22.0052 22.0448 21.8269    21.8566> >
as.POSIXct(floor(data[,"Date"][1:6]*86400),origin=ISOdatetime(1899,12,30,0,0,0,tz=""))[1]
"2011-08-01 09:35:00 CDT" "2011-08-01 09:39:59 CDT" "2011-08-01
09:44:59 CDT" "2011-08-01 09:50:00 CDT" "2011-08-01 09:55:00 CDT"
[6] "2011-08-01 10:00:00 CDT"



This works nicely, but I'm wondering if I'm not quite specifying
something correctly because some entires are not exactly 5 minutes
apart - or might this

just be an imprecision in the data?



It's also one hour ahead, but I guess this is due to DST adjustment I
need to make.  I tried to verify the output of as.POSIXct in Excel,
but it doesn't

give accuracy to seconds (or at least I don't know how if it does....)



Any advice is appreciated.



John

	[[alternative HTML version deleted]]

