You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The timestamp arithmetic added in #4038 fails to correctly account for timezones
#[test]
fn test_timezone_interval() {
let tz_str = "-01:00";
let tz: Tz = tz_str.parse().unwrap();
let array =
TimestampNanosecondArray::from(vec![2419200000000000]).with_timezone(tz_str);
let value = array.value_as_datetime_with_tz(0, tz).unwrap();
assert_eq!(value.to_rfc3339(), "1970-01-28T23:00:00-01:00");
// Add 1 month
let interval = IntervalYearMonthArray::from(vec![1]);
let date = add_dyn(&array, &interval).unwrap();
let output = date.as_primitive::<TimestampNanosecondType>();
let value = output.value_as_datetime_with_tz(0, tz).unwrap();
assert_eq!(value.to_rfc3339(), "1970-02-28T23:00:00-01:00");
}
The above test should pass but it instead fails with the result 1970-02-27T23:00:00-01:00. This is because the month addition is done in the UTC epoch instead of the epoch of the array's timezone.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The timestamp arithmetic added in #4038 fails to correctly account for timezones
The above test should pass but it instead fails with the result
1970-02-27T23:00:00-01:00
. This is because the month addition is done in the UTC epoch instead of the epoch of the array's timezone.Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: