R: unknown time zone with as.POSIXct ()

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

I need to specify time intervals (Europe / London or UTC) when I call as.POSIXct ().

If I run

> t<-as.POSIXct(1445329330, tz="Europe/London", origin="1970-01-01")
> t

R returns "2015-10-20 09:22:10 BST" Warning messages: 1: In as.POSIXlt.POSIXct (x, tz): unknown time zone 'default / Europe / London' 2: In as.POSIXlt.POSIXct (x, tz): unknown time zone 'default / Europe / London'

I tried to specify tz = "BST", but this also returns warnings

Warning messages:
1: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'BST
          '
2: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Europe/London'
3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'BST
          '
4: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Europe/London'

/zone.tab "/" zone.tab, "BST" . , / tz. ?

- , , as.POSIXct?

, , as.POSIXct(), MacOS High Sierra. ? Sys.timezone(), NA

Iris

+2
3

, , .

NA, , Sys.setenv(TZ='Twilight Zone'), -, tz , .

+1

macOS High Sierra 10.13.1. - , .

> as.POSIXct("2017-10-01", format = "%Y-%m-%d")
[1] "2017-10-01 GMT"
Warning message:
In strptime(x, format, tz = tz) :
  unknown timezone 'zone/tz/2017c.1.0/zoneinfo/Pacific/Auckland'

, , .

> Sys.setenv(TZ = "Pacific/Auckland")
> as.POSIXct("2017-10-01")
[1] "2017-10-01 NZDT"

, , - .

, . R Core Team , macOS 10.13 Beta Apple .

Sys.setenv(TZ = "Pacific/Auckland") .Rprofile , , RStudio. , .

, , .Rprofile, .

: , R 3.4.3. R news. .

UNIX-ALIKE

macOS 10.13 'High Sierra' 10.13.1, , R - -with-internal-tzcode ( macOS).

, R /.

> Sys.timezone()
[1] "Pacific/Auckland"
> Sys.time()
[1] "2017-12-30 16:22:32 NZDT"
+5

, "/", ( "BST" "default/Europe/London" ).

, ? , as.POSIXct(1445329330, tz="Europe/London", origin="1970-01-01") R?

I still get the error about BST even if you use the correct time zone

> 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'
0
source

Source: https://habr.com/ru/post/1669296/


All Articles