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

Temporal utilities miss variations due to daylight savings #901

Closed
novemberkilo opened this issue Nov 1, 2021 · 2 comments · Fixed by #955
Closed

Temporal utilities miss variations due to daylight savings #901

novemberkilo opened this issue Nov 1, 2021 · 2 comments · Fixed by #955
Assignees

Comments

@novemberkilo
Copy link
Contributor


    #[cfg(feature = "chrono-tz")]
    #[test]
    fn test_temporal_array_timestamp_hour_with_dst_timezone_using_chrono_tz() {
        //
        // 1635577147 converts to 2021-10-30 17:59:07 in time zone Australia/Sydney (AEDT)
        // The offset (difference to UTC) is +11:00. Note that daylight savings is in effect on 2021-10-30.
        // When daylight savings is not in effect, Australia/Sydney has an offset difference of +10:00.

        let a = TimestampMillisecondArray::from_opt_vec(
            vec![Some(1635577147000)],
            Some("Australia/Sydney".to_string()),
        );
        let b = hour(&a).unwrap();
        assert_eq!(17, b.value(0));
    }

This test fails - it returns 16 instead of 17 and demonstrates that the offset for the timezone is not correctly taking daylight savings into account.

Originally posted by @novemberkilo in #849 (comment)

@novemberkilo
Copy link
Contributor Author

I have a fix in the works - please assign to me as appropriate. // @alamb

@novemberkilo
Copy link
Contributor Author

@alamb I have a fix on a branch that builds off my work in #849 -- here is the diff novemberkilo/arrow-rs@master...novemberkilo:topic/dst-bug-temporal

I suggest we work through #849 and then I will put up a PR separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant