unknown timezone name in R strptime/as.POSIXct

前端 未结 5 525
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 04:09

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 \

5条回答
  •  清歌不尽
    2020-12-06 04:54

    Couldn't find it in that location on my make but found a zipped version in a source directory. Here's a list of timezone abbreviations that appear at the top level of the zones.tab file:

    CET, CST6CDT, Cuba, EET, EST, EST5EDT, Egypt, Eire, Factory, GB, GB-Eire, GMT,
    GMT+0, GMT-0, GMT0, Greenwich, HST, Hongkong, Iceland, Iran, Israel, Jamaica, Japan,
    Kwajalein, Libya, MET, MST, MST7MDT, NZ, NZ-CHAT, Navajo, PRC, PST8PDT, Poland, Portugal,
    ROC, ROK, Singapore, Turkey, UCT, UTC, Universal, W-SU, WET, Zulu
    

    There are also folders with continent/country names, which have more options such as the America/New_York example above.:

    Africa/     Asia/       Canada/     Indian/
    America/    Atlantic/   Chile/      Mexico/
    Antarctica/ Australia/  Etc/        Pacific/
    Arctic/     Brazil/     Europe/     US/
    

    This was found in the /R-2.11.1/src/extra/tzone/zoneinfo.zip file.

提交回复
热议问题