I'm trying to convert a string to POSIXct in R v3.1.1 on Mac OS X Mavericks (10.9.4). This worked before upgrading Mavericks then R. My very simple code is now giving a warning and I don't understand why :-
as.POSIXct("2014-05-24 12:45", "%Y-%m-%d %hh:%mm")
[1] "2014-05-24 12:45:00 GMT"
Warning messages:
1: In strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone '%Y-%m-%d %hh:%mm'
2: In as.POSIXct.POSIXlt(x) : unknown timezone '%Y-%m-%d %hh:%mm'
3: In strptime(xx, f <- "%Y/%m/%d %H:%M:%OS", tz = tz) :
unknown timezone '%Y-%m-%d %hh:%mm'
4: In as.POSIXct.POSIXlt(x) : unknown timezone '%Y-%m-%d %hh:%mm'
5: In strptime(xx, f <- "%Y-%m-%d %H:%M", tz = tz) :
unknown timezone '%Y-%m-%d %hh:%mm'
6: In as.POSIXct.POSIXlt(x) : unknown timezone '%Y-%m-%d %hh:%mm'
7: In strptime(x, f, tz = tz) : unknown timezone '%Y-%m-%d %hh:%mm'
8: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
unknown timezone '%Y-%m-%d %hh:%mm'
9: In as.POSIXlt.POSIXct(x, tz) : unknown timezone '%Y-%m-%d %hh:%mm'
I tried defining the timezone using the following but got an NA returned :-
as.POSIXct("2014-05-24 12:45", "%Y-%m-%d %hh:%mm", tz="Europe/London")
[1] NA
Not sure what I'm doing wrong here.
Thanks in advance for any help.