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

Time zone: support fixed offset e.g. UTC+8 #7338

Closed
jon-chuang opened this issue Jan 12, 2023 · 2 comments
Closed

Time zone: support fixed offset e.g. UTC+8 #7338

jon-chuang opened this issue Jan 12, 2023 · 2 comments

Comments

@jon-chuang
Copy link
Contributor

jon-chuang commented Jan 12, 2023

Currently, we only support geographical timezones for interpretation of timezone strings in AT TIME ZONE and session time zone

Note that PG supports such strings.

@jon-chuang
Copy link
Contributor Author

jon-chuang commented Jan 12, 2023

Seems that postgres' implementation is quite weird. asia/singapore is equivalent to utc-8, not utc+8... 🤔 , in fact set timezone = '+8' is UTC+8 as expected, but anything (literally any string) followed by +8 becomes UTC-8 🤔

@xiangjinwu
Copy link
Contributor

https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES

PostgreSQL allows you to specify time zones in three different forms:

  • A full time zone name, for example America/New_York.
    • PostgreSQL uses the widely-used IANA time zone data for this purpose, so the same time zone names are also recognized by other software.
  • A time zone abbreviation, for example PST. Such a specification merely defines a particular offset from UTC, in contrast to full time zone names which can imply a set of daylight savings transition rules as well.
    • You cannot set the configuration parameters TimeZone or log_timezone to a time zone abbreviation, but you can use abbreviations in date/time input values and with the AT TIME ZONE operator.
  • In addition to the timezone names and abbreviations, PostgreSQL will accept POSIX-style time zone specifications, as described in Section B.5. This option is not normally preferable to using a named time zone, but it may be necessary if no suitable IANA time zone entry is available.
    • The positive sign is used for zones west of Greenwich. (Note that this is the opposite of the ISO-8601 sign convention used elsewhere in PostgreSQL.)

Let's stick to the first option.

@jon-chuang jon-chuang closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants