-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for more UTC-equivalent time zones
There are several other ways to specify UTC and GMT time zones: Etc/UTC, Etc/GMT, GMT-0, GMT+0, GMT0 Thanks to Michael Chirico for the report! Fixes #319.
- Loading branch information
1 parent
6287228
commit a9e6573
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,9 +128,10 @@ function (year = 1970, | |
} | ||
# strptime has an issue (bug?) which returns NA when passed | ||
# 1969-12-31-23-59-59; pass 58.9 secs instead. | ||
sysTZ <- Sys.getenv("TZ") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
joshuaulrich
Author
Owner
|
||
if (length(c(year, month, day, hour, min, sec)) == 6 && | ||
all(c(year, month, day, hour, min, sec) == c(1969, 12, 31, 23, 59, 59)) && | ||
Sys.getenv("TZ") %in% c("", "GMT", "UTC")) | ||
(sysTZ == "" || isUTC(sysTZ))) | ||
sec <- sec-1 | ||
ISOdatetime(year, month, day, hour, min, sec, tz) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should we add
unset=NA
here? AIUITZ=
means UTC, but TZ unset means local?Came up here: Rdatatable/data.table#4608