I have a dataframe with dates and I am trying to convert it to a POSIXct object but I am unable to specify timezone. Any idea why this is happening?
> str(dates)
'data.frame': 3171 obs. of 3 variables:
$ Date : Date, format: "2013-05-14" "2013-08-15" "2014-05-30" "2014-09-29" ...
$ BB_Ticker: Factor w/ 1252 levels "A US Equity",..: 1 2 2 2 2 2 2 2 2 2 ...
$ 1Y : POSIXct, format: "2013-05-13 20:00:00" "2013-08-14 20:00:00" "2014-05-29 20:00:00" "2014-09-28 20:00:00" ..
I tried specifying "America/New_York"
as well as "EST5EDT"
but it had no effect -
> head(as.POSIXct(dates$Date, tz = "GMT"), 3)
[1] "2013-05-13 20:00:00 EDT" "2013-08-14 20:00:00 EDT" "2014-05-29 20:00:00 EDT"
> head(as.POSIXct(dates$Date, tz = "America/New_York"), 3)
[1] "2013-05-13 20:00:00 EDT" "2013-08-14 20:00:00 EDT" "2014-05-29 20:00:00 EDT"
> head(as.POSIXct(dates$Date, tz = "EST5EDT"), 3)
[1] "2013-05-13 20:00:00 EDT" "2013-08-14 20:00:00 EDT" "2014-05-29 20:00:00 EDT"