Create a TimeZone from a UTC offset
- Status
- Fixed
- Fixed in
- v26.10.4
- Area
- compiler
- Source discussion
- -
- Last updated
- 2026-10-30
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Objo users can read a timezone's UTC offset (TimeZone.OffsetAt(date) and TimeZone.BaseOffset, both Duration values), but they cannot construct a timezone from a raw UTC offset: the only ways to create a TimeZone are TimeZone.Current, TimeZone.UTC and TimeZone.FromIdentifier.
This matters for values stored as a wall-clock DateTime plus an offset in seconds (a common pattern for document timestamps and other data whose source timezone is just an offset): converting such a value to UTC or another timezone today requires manual tick arithmetic, since the conversion APIs all take a TimeZone object.
Requested: TimeZone.FromOffset accepting a Duration (or seconds), returning a fixed-offset timezone with no daylight-saving rules, so ToUTC, FromUTC, Convert and OffsetAt all work on it directly.