apache / apache/iotdb

[Bug] Timezone offset bug in DateTimeUtils

オープン
#17,433 コメント 1 件 リアクション 1 件 担当者 1 名 @Lexert19 が担当を希望しています GitHub で見る
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
115

説明

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

c91688bd47

### Describe the bug and provide the minimal reproduce step

The core issue lies in org.apache.iotdb.db.utils.datetimeutils.DateTimeUtils.toZoneOffset(ZoneId zoneId). This method calculates the timezone offset using Instant.now(). In regions that observe Daylight Saving Time (DST), such as Europe/Warsaw, the offset is not constant throughout the year (+1 in winter, +2 in summer).
timezone: Europe/Warsaw
INSERT INTO root.test.d1(time, s1) VALUES(2024-01-01T00:00:00, 1);
SELECT s1 FROM root.test.d1;

### What did you expect to see?

2024-01-01T00:00:00+01:00

### What did you see instead?

2023-12-31T23:00:00.000+01:00

### Anything else?

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。