最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

time - Which timezones exceed the POSIX-required UT Offset range? - Stack Overflow

programmeradmin0浏览0评论

The section on Version 3 of the tzfile format from the man pages for tzfile states that:

... the hours part of its transition times may be signed and range from -167 through 167 instead of the POSIX-required unsigned values from 0 through 24.

However, the List of UTC offsets on wikipedia only lists zones between UTC-12 and UTC+14. The same goes for timezones listed on the List of tz database time zones.

  • Are there any timezones that have a Universal Time offset greater than 24? When would this ever occur?
  • Why would support for +/- 167 hours be added in Version 3?
  • Is this referring to UT Offset listed in the ttinfo entries, or is it referring only to the POSIX.1-2017-style TZ string?

The section on Version 3 of the tzfile format from the man pages for tzfile states that:

... the hours part of its transition times may be signed and range from -167 through 167 instead of the POSIX-required unsigned values from 0 through 24.

However, the List of UTC offsets on wikipedia only lists zones between UTC-12 and UTC+14. The same goes for timezones listed on the List of tz database time zones.

  • Are there any timezones that have a Universal Time offset greater than 24? When would this ever occur?
  • Why would support for +/- 167 hours be added in Version 3?
  • Is this referring to UT Offset listed in the ttinfo entries, or is it referring only to the POSIX.1-2017-style TZ string?
Share Improve this question asked Nov 19, 2024 at 16:53 AlectoAlecto 10.8k1 gold badge28 silver badges50 bronze badges 2
  • not sure if this is helpful but RFC9636 TZif files should have a value in their utoff field [-89999, 93599] seconds ([-24:59:59, 25:59:59]), see sect. 3.2. That sounds more practical to me than -167 through 167 hours. An offset > 24h might occur if you want to shift a timezone by more than a day. Sounds rare to me but not impossible. – FObersteiner Commented Nov 20, 2024 at 16:05
  • 2 I think you may be conflating two different things. The transition time is not a UTC offset - it's a part of the rule that describes when to switch from DST to standard time, or vice versa. This page describes it better, and gives an example (Israel's time transitions) with a transition time of 26 hours - in context, that 26 means that the time change from standard time to DST occurs at 26 hours after midnight (local time) at the beginning of March’s fourth Thursday. – Mark Dickinson Commented Nov 27, 2024 at 14:48
Add a comment  | 

1 Answer 1

Reset to default 0

As you pointed out, there are, at the time of writing, no timezones that have a Universal Time offset greater than 24 hours. This would occur when a governmental body declares it. Support for +/- 167 hours was likely added in Version 3 to handle that possibility. Consider that these offsets are specified by governmental decree, so the authors of this standard/code probably imagined that a bureaucrat may want to shift their timezone by nearly 1 week since 167 hours = 6 days and 23 hours. This is basically referring to both the UT Offset listed in the ttinfo entries, and to the POSIX.1-2017-style TZ string (), as explained in the man pages.

发布评论

评论列表(0)

  1. 暂无评论