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

format_datetime fails with +00:00 not found in timezone database #10101

Closed
mbasmanova opened this issue Jun 7, 2024 · 4 comments
Closed

format_datetime fails with +00:00 not found in timezone database #10101

mbasmanova opened this issue Jun 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@mbasmanova
Copy link
Contributor

mbasmanova commented Jun 7, 2024

Bug description

TEST_F(DateTimeFunctionsTest, xxx) {
  auto r = evaluateOnce<std::string>(
      "format_datetime(from_unixtime(0.0, 'UTC'), 'yyyy-MM-dd HH:mm:ss')",
      std::optional(123));

  ASSERT_TRUE(r.has_value());
  LOG(ERROR) << r.value();
}

[ RUN      ] DateTimeFunctionsTest.xxx

terminate called after throwing an instance of 'facebook::velox::VeloxUserError'
  what():  Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: +00:00 not found in timezone database
Retriable: False
Context: Top-level Expression: format_datetime(0:TIMESTAMP WITH TIME ZONE, yyyy-MM-dd HH:mm:ss:VARCHAR)

Similar errors:

  • Etc/GMT+7: -07:00 not found in timezone database
  • Etc/GMT+8: +08:00 not found in timezone database

They come from date::locate_zone("+00:00").

CC: @pedroerp @amitkdutta

System information

n/a

Relevant logs

No response

@mbasmanova mbasmanova added bug Something isn't working triage Newly created issue that needs attention. labels Jun 7, 2024
@PHILO-HE
Copy link
Contributor

PHILO-HE commented Jun 7, 2024

FYI. Quote:
"date::locate_zone() only recognizes IANA time zone names. Here is a list of the IANA time zone names:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"

Source HowardHinnant/date#823 (comment).

@pedroerp pedroerp self-assigned this Jun 11, 2024
@mbasmanova
Copy link
Contributor Author

@pedroerp Pedro, any update on this?

@pedroerp
Copy link
Contributor

@pedroerp Pedro, any update on this?

I haven't had the time to start on this yet. Unless anyone has bandwidth to take this first, my plan is to start early next week.

pedroerp added a commit to pedroerp/velox-1 that referenced this issue Jul 26, 2024
Summary:
Adding support for time zone offsets to TimeZone. Now, we will be able
to clean up the callsites to use this single APIs, which will contain time zone
name, ID, and conversion capabilities in a more consistent manner.

Part of facebookincubator#10101

Reviewed By: mbasmanova

Differential Revision: D60213004
facebook-github-bot pushed a commit that referenced this issue Jul 26, 2024
Summary:
Pull Request resolved: #10577

Adding support for time zone offsets to TimeZone. Now, we will be able
to clean up the callsites to use this single APIs, which will contain time zone
name, ID, and conversion capabilities in a more consistent manner.

Part of #10101

Reviewed By: mbasmanova

Differential Revision: D60213004

fbshipit-source-id: 186809ba397b494b66fbf8d48b04028fc568caa7
pedroerp added a commit to pedroerp/velox-1 that referenced this issue Jul 30, 2024
Summary:
In the recent time zone support improvements, time zone offset support
was added to the same API used for regular time zones. Hence, functions based
on this API now also support offests. Adding unit tests to ensure
format_datetime() has the expected behavior.

Addresses facebookincubator#10101

Differential Revision: D60430532
@pedroerp
Copy link
Contributor

This is the last one to address this Issue:

#10606

facebook-github-bot pushed a commit that referenced this issue Jul 30, 2024
Summary:
Pull Request resolved: #10606

In the recent time zone support improvements, time zone offset support
was added to the same API used for regular time zones. Hence, functions based
on this API now also support offests. Adding unit tests to ensure
format_datetime() has the expected behavior.

Addresses #10101

Reviewed By: mbasmanova

Differential Revision: D60430532

fbshipit-source-id: d471632526ef56ab313bca34d34079a8ecd48a6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Newly created issue that needs attention.
Projects
None yet
Development

No branches or pull requests

3 participants