3

I've been getting annoying time zone warnings when I run a script with POSIX commands to I decided to investigate. When I run the following commands on startup

Sys.time()
Sys.Date()
Sys.timezone()

I get

> date()
[1] "Mon Nov 27 09:10:32 2017"
> Sys.time()
[1] "2017-11-27 16:10:51 GMT"
> Sys.Date()
[1] "2017-11-27"
> Sys.timezone()
[1] NA
> 

When I look under the Date & Time Zone tab in my mac settings, I see that the time zone is set correctly to Mountain Standard Time. Finally, when I first run some code that looks for time zone information I get the following warning message

Warning messages:
1: In as.POSIXlt.POSIXct(x, tz) :
  unknown timezone 'zone/tz/2017c.1.0/zoneinfo/America/Denver'

As far as I can tell I don't have a path on my mac that looks like "zone/tz/..." so the question is how to get POSIX looking in the correct place(s) for timezone information.

JerryN
  • 2,356
  • 1
  • 15
  • 49
  • 2
    See this related question: https://stackoverflow.com/questions/47314121/r-error-unknown-timezone-with-as-posixct/47467017#47467017 – Dave2e Nov 29 '17 at 01:19

1 Answers1

1

According to the new features list in R 3.4.3, released Nov 30 2017,

A workaround has been added for the changes in location of time-zone files in macOS 10.13 'High Sierra' and again in 10.13.1, so the default time zone is deduced correctly from the system setting when R is configured with --with-internal-tzcode (the default on macOS).

MRO 3.4.3 will be available on 2018-01-10 for those using Microsoft's version of R.

JerryN
  • 2,356
  • 1
  • 15
  • 49