Datetime with a time zone name shifts by an hour around DST
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 66/100
Hướng nghiên cứu
Start with DatetimeToStringConverter.Convert and StringToDatetimeConverter.Convert in converter.go, then run the reproduction using the Europe/Paris fall-back time. Check that formatting includes the offset with the zone name and parsing accepts both forms while rejecting an offset the zone does not have at that time. Done means the round trip preserves the original instant.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Reproduction snippets assume:
fac := tupleconv.MakeStringToTTConvFactory()
Where: DatetimeToStringConverter.Convert (converter.go:356), StringToDatetimeConverter.Convert (converter.go:200).
For a datetime with a time zone name, the string form is <local time> <zone name> without an offset. During a DST fall-back hour the same local time happens twice, and the parser always picks one of them.
Reproduction:
paris, _ := time.LoadLocation("Europe/Paris")
cest := time.Date(2023, 10, 29, 0, 30, 0, 0, time.UTC).In(paris)
dt, _ := datetime.NewDatetime(cest)
s, _ := tupleconv.MakeDatetimeToStringConverter().Convert(dt)
back, _ := tupleconv.MakeStringToDatetimeConverter().Convert(s)
bdt := back.(datetime.Datetime)
fmt.Printf("%s -> %q -> %s\n", cest, s, bdt.ToTime())
2023-10-29 02:30:00 +0200 CEST -> "2023-10-29T02:30:00 Europe/Paris" -> 2023-10-29 02:30:00 +0100 CET
Expected: the round trip keeps the instant.
Suggested fix: write the offset together with the zone name, e.g. 2023-10-29T02:30:00+0200 Europe/Paris. When parsing, accept both forms; if the offset is present, choose the instant with that offset and reject an offset the zone doesn't have at that time.
- Ngôn ngữ chính
- Go
- Star
- 1
- Fork
- 0
- Merge trung bình
- 1 giờ 43 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tarantool/go-tupleconv
-
build issue code health
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
tarantool/go-tupleconv#27 ·
-
code health
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tarantool/go-tupleconv#26 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tarantool/go-tupleconv#25 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tarantool/go-tupleconv#23 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
tarantool/go-tupleconv#22 ·
Tất cả issue của tarantool/go-tupleconv
Issue tương tự
-
agent-research-finding chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jordansmall/spindrift#7370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
☢️ Bug v3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
The repo's gates check is clean and runs need no swapsCó thể đã có người làm @turbot-agent-fleet đã nhận hôm nay. Đang mởagent:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
turbot/tailpipe#677 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-kind needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
crossplane-contrib/provider-keycloak#806 ·
Maintainer thường phản hồi trong vòng 1 ngày