Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yearmonth() throws an error with C_force_tz #1166

Closed
Mkranj opened this issue Jun 18, 2024 · 3 comments
Closed

yearmonth() throws an error with C_force_tz #1166

Mkranj opened this issue Jun 18, 2024 · 3 comments
Labels
reprex needs a minimal reproducible example

Comments

@Mkranj
Copy link

Mkranj commented Jun 18, 2024

I'm analysing some timeseries, but I cannot use the yearmonth() function. Running the following code:

yearmonth("2018 January")

I get this error message: Error in C_force_tz(utc, tz, c("boundary", "post")) : CCTZ: Unrecognized output timezone: "Europe/Zagreb".

Reading through similar issues, I can confirm that using lubridate:::tzdir_get() returns a folder that exists, "C:/PROGRA~1/R/R-43~1.3/share/zoneinfo" . I've used tzdir_set to explicitly set the full path, and still no use. Changing locale setting to en_US.utf8 still results in the same error.

yearmonth() is actually a function from the tsibble package, however C_force_tz makes me think it could be related to lubridate. I'll reopen the issue on tsibble if you think it's more appropriate.

I'm using lubridate 1.9.3, tsibble 1.1.4 and R 4.3.3. on Windows 11. How can I fix these problems?

@jcoloso
Copy link

jcoloso commented Nov 7, 2024

I had a similar problem with R 4.4.2 and lubridate 1.9.3 where I was getting the same Unrecognized output timezone error. Reverting to R 4.4.1 fixed the issue for me.

@vspinu
Copy link
Member

vspinu commented Dec 4, 2024

HI @Mkranj could you reproduce it more directly with ymd_hms("2024-01-01 00:00:00", tz="Europe/Zagreb")?

Have you actually checked that your tzinfo contains Zagreb file? It would be weird if it does not but just in case. What about other more common time zones like "Europe/Amsterdam", "Europe/Berlin"?

@vspinu vspinu added the reprex needs a minimal reproducible example label Dec 4, 2024
@vspinu
Copy link
Member

vspinu commented Dec 4, 2024

There are a bunch of similar issues reported. It has to be a local mis-configuration or mis-instalation issue.

For incorrect instalation example refer to this explaination.

If it's a timezone mis-configuration then it's easy to fix - simply set the env variable TZDIR to the correct path before loading lubridate. Lubridate tries to figure it automatically during the load time. Please check if lubridate:::tzdir_find returns the existing tzinfo path and it really exists. There is a chance that our tzdir_find need improvement. In that case please open a new issue with a proposal.

@vspinu vspinu closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

3 participants