R error: unknown timezone with as.POSIXct()

前端 未结 3 1415
孤街浪徒
孤街浪徒 2020-12-10 00:09

I am trying to convert a unix epoch timestamps to a date-time object using as.POSIXct()

I need to specify timezones (either Europe/London or UTC) when I call as.POSI

3条回答
  •  感动是毒
    2020-12-10 00:45

    Looking at the output it is not actually giving a warning about 'Europe/London', just about other variations ('BST' and 'default/Europe/London').

    Could it be that it are errors of previous commands still lingering? Do you get the same if run you the as.POSIXct(1445329330, tz="Europe/London", origin="1970-01-01") again, or even restart R?

    I still get the error about BST even if using the correct timezone

    > as.POSIXct(1445329330, tz="BST", origin="1970-01-01")
    [1] "2015-10-20 08:22:10 GMT"
    Warning message:
    In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'BST'
    > as.POSIXct(1445329330, tz="Europe/London", origin="1970-01-01")
    [1] "2015-10-20 09:22:10 BST"
    Warning message:
    In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'BST'
    

提交回复
热议问题