2

A similar question was asked here but remained unanswered so please do not mark it duplicate. The problem is the moment you assign a time zone e.g. tz="Asia/Kolkata" - or any other timezone (I tried a couple others and all are giving the same warnings).

as.POSIXct("2017-11-01 10:52", "%Y-%m-%d %H:%M", tz = "Asia/Kolkata")
Warning messages:
1: In strptime(x, format, tz = tz) :
  unknown timezone 'default/Asia/Kolkata'
2: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
  unknown timezone 'default/Asia/Kolkata'
3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'

I also tried using the lubridate package:

ymd(20171115,tz = "Asia/Kolkata")

# [1] "2017-11-15 IST"
Warning messages:
1: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
2: In as.POSIXct.POSIXlt(lt) : unknown timezone 'default/Asia/Kolkata'
3: In as.POSIXlt.POSIXct(ct) : unknown timezone 'default/Asia/Kolkata'
4: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'

Seems this has become an epidemic. Now even sourcing my code which was clean is giving dozens of warnings - all the same.

There were 50 or more warnings (use warnings() to see the first 50)

> warnings()

Warning messages:
1: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
2: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
4: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
5: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
6: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
7: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
8: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'
9: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata

What's happening here?

Lazarus Thurston
  • 1,197
  • 15
  • 33
  • Why don't you try India Standard Time as Time Pine? – MKR Nov 10 '17 at 07:05
  • 1
    This is probably system dependent. Please provide information about your OS. Also, have you checked if the problem persists in a clean, vanilla R session? – Roland Nov 10 '17 at 07:18
  • @Roland, that is a possibility. I have only yesterday upgraded my Mac to Mac OS HIGH SIERRA. I can see hundreds of files when i locate the string 'zoneinfo' on my mac command line... and i spot this is there. /Library/Frameworks/R.framework/Versions/3.3/Resources/share/zoneinfo/Asia/Kolkata – Lazarus Thurston Nov 10 '17 at 07:30
  • @MKR - i tried "IST" string but it still gives the same error. – Lazarus Thurston Nov 10 '17 at 07:33
  • How have you installed R? Have you tried reinstalling it (in particular, if you had installed it from source, possibly via homebrew or macports)? – Roland Nov 10 '17 at 08:42
  • Why would I reinstall R again? Unless there is no other way to fix this trvial timezone issue. – Lazarus Thurston Nov 10 '17 at 10:20
  • Because you did a major OS upgrade? If you installed R from source you should definitely reinstall. – Roland Nov 10 '17 at 13:21
  • I didn't install from source. It was from CRAN. Do I still reinstall R? I am a but afraid as last time I reinstalled R a lot of my packages started giving errors asking me to upgrade them – Lazarus Thurston Nov 10 '17 at 14:36

1 Answers1

4

I've the some issue, if your on High Sierra it seems to be a bug between OS HS and R 3.4.2 as it is said in this post https://github.com/stan-dev/rstan/issues/455 Following the instructions (until R 3.4.3 will finally release) works for me. I do:

Sys.setenv(TZ="Europe/Madrid")

Now I can load packages and no messages pop up. Hope it helps!

Edited

R 3.4.3 was released and the problem is fixed.

Tito Sanz
  • 1,280
  • 1
  • 16
  • 33