-
Notifications
You must be signed in to change notification settings - Fork 684
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
Use timezone name like "-08:00" for locate_zone()
#823
Comments
I believe you may be interested in the names that are similar to "Etc/GMT+8". Note the curious reversal in the sign of the offset. I.e. "Etc/GMT+8" has a UTC offset of -08:00. Note that there are no IANA names that handle offsets that are not a multiple of hours. If you need such a thing, one can write custom time zones for arbitrary UTC offsets. For an example of such see "Custom time zone" at this link: https://howardhinnant.github.io/date/tz.html#Examples |
@HowardHinnant, thanks so much for your clear reply! |
In our code, we pass user-specified timezone name to
date::locate_zone()
to getdate::time_zone*
. It works well when timezone name is like "America/Los_Angeles". But when an offset timezone name is specified, e.g., "-08:00", we found it cannot be recognized by timezone database, even though these options are set: AUTO_DOWNLOAD=1, HAS_REMOTE_API=1. Is this an expected behavior? Thanks in advance!The text was updated successfully, but these errors were encountered: