Search code examples
rtimezonestrptime

unknown timezone name in R strptime/as.POSIXct


Where can I find a list of all legal time names for R function as.POSIXct?

as.POSIXct("1970-01-01",tz="CST") generates a warning that "CST" (Central Standard Time) is unknown.


Solution

  • ?Sys.timezone has some hints, specifically to look in: "R_HOME/share/zoneinfo/zone.tab" (R_HOME is the directory R is installed in). Keep in mind that time zones are nasty and many of their nuances are operating system (and locale?) specific.

    In your specific case, you want "CST6CDT" instead of "CST".