bitwalker / bitwalker/timex

could_not_resolve_timezone error when converting a date during DST changeover

Open
#691 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.8k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

I know this has been brought up in previous issues #555 and #625 but this doesn't seem to be resolved in the latest release 3.7.6 so I am creating a new issue.

### Steps to reproduce

Convert a date between 2am and 3am on 3 October 2021 to "Australia/Melbourne" timezone.

Example:

`~N[2021-10-03 02:31:07] |> Timex.Timezone.convert("Australia/Melbourne")`

Output:

`{:error,
{:could_not_resolve_timezone, "Australia/Melbourne", 63800447467, :wall}}`

This looks to be a DST issue, because the following (an hour earlier, before the DST switch) works:

`~N[2021-10-03 01:31:07] |> Timex.Timezone.convert("Australia/Melbourne")`

Output:

`#DateTime<2021-10-03 01:31:07+10:00 AEST Australia/Melbourne>`

Daylight saving time Melbourne began at 2:00 am on Sunday, 3 October 2021. The error occurs any trying to convert a date anytime between 2am and 3am.

### What are the expected results?

I expect the date will be converted to a timezone without an error regardless of whether the time is in a DST changeover period or not for the given timezone.

Thanks for any assistance! - Ian

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.