Closed martintmk closed 2 weeks ago
set_offset
would be the way to go. It is definitely wildly inappropriate to assume UTC in cases like this. It might be appropriate in very specific circumstances, but implicitly always assuming UTC is I believe widely considered a source of many many many bugs.
Parsing custom UTC timestamp format:
Fails with the following error:
This surprised me as I thought that zero offset would be used by default for timestamps if time zone information is not found. The
BrokenDownTime
offers some modification APIs such asset_month
,.,set_second
, however,set_offset
is missing here. This would at least allow me to do:Would it make sense to fallback to UTC offset here?
https://github.com/BurntSushi/jiff/blob/d5f5f4518ed4fa4d5b5017d83fddc0932970600c/src/fmt/strtime/mod.rs#L806
If not, exposing
BrokenDownTime::set_offset
should suffice.