Open nunotexbsd opened 10 months ago
No idea, was it working with the older version?
As the message suggests your tzone database might not be in the location as suggested. Our tzone db lookup is here Very simple code, you can see what's going on by yourself. If your problem is generic then a PR would be very much appreciated. Thanks!
Our results are good on debian and fedora, so if indeed an issue it's FreeBSD specific.
@vspinu
It seems that some canonical TZs originates the error, EST in tests. Any clue about it? Maybe a R configuration that needs be fixed?
Attaching package: ‘lubridate’
The following objects are masked from ‘package:base’:
date, intersect, setdiff, union
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "EST"), usetz = TRUE)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'format_ISO8601': character string is not in a standard unambiguous format
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "Europe/Lisbon"), usetz = TRUE)
[1] "2018-02-01T03:04:05+0000"
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "GMT"), usetz = TRUE)
[1] "2018-02-01T03:04:05+0000"
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "MET"), usetz = TRUE)
[1] "2018-02-01T03:04:05+0100"
Sorry, I misread. This is R base error and not lubridate specific. Strange for sure. It's probably tzone database related but the error is confusing. It might be worth reporting this to R folks.
6. +-base::as.POSIXct.default("2018-02-01 03:04:05", tz = "EST")
7. | +-base::as.POSIXct(as.POSIXlt(x, tz, ...), tz, ...)
8. | +-base::as.POSIXlt(x, tz, ...)
9. | \-base::as.POSIXlt.character(x, tz, ...)
10. | \-base::stop("character string is not in a standard unambiguous format")
I see this when calling Sys.timezone()
.
> Sys.timezone()
Warning: Your system is mis-configured: ‘/etc/localtime’ is not a symlink
Warning: It is strongly recommended to set envionment variable TZ to ‘America/Halifax’ (or equivalent)
[1] "America/Halifax"
On FreeBSD /etc/localtime
isn't a symlink, but a copy of the timezone file under /usr/share/zoneinfo
. When I back up /etc/localtime
and create a symlink, there is no warning.
# mv localtime localtime.bak
# ln -s /usr/share/zoneinfo/America/Halifax .
# mv localtime localtime.bak
# ln -s /usr/share/zoneinfo/America/Halifax /etc/localtime
% R --quiet -e "Sys.timezone()"
> Sys.timezone()
[1] "America/Halifax"
@nunotexbsd, do you have /etc/localtime
? If so, does it match an entry in the timezone database? You can check with something like find /usr/share/zoneinfo/ -type f -exec cmp -s {} /etc/localtime \; -print;
.
@Jehops
Hello and sorry for delay!
I'm running in a poudriere jail and /etc/localtime was not exist. I did create a symlink and R shows:
> Sys.timezone()
[1] "Europe/Lisbon"
It doesn't solve the following command (called by test unit):
> library(lubridate)
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "EST"), usetz = TRUE)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'format_ISO8601':
character string is not in a standard unambiguous format
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "GMT"), usetz = TRUE)
[1] "2018-02-01T03:04:05+0000"
> format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz = "Europe/Lisbon"), usetz = TRUE)
[1] "2018-02-01T03:04:05+0000"
Something wrong with "EST" timezone and it doesn't seems related to system /etc/localtime.
Thanks
FreeBSD 13.2 /R 4.3.1
Any clues? Thanks