Parsing offsets of the form +01:00 can be done with chrono alone.
Parsing any other timezone must be done with chrono-tz.
When we want to support the former, and optionally (i.e. via a feature gate) support the latter, it would be very useful to be able to convert chrono_tz::Tz to chrono::FixedOffset because it avoids having to write a generic for it.
this code would be much simpler if utf8_to_timestamp_ns_impl was not a generic. This is a simple example, but I find myself writing more complex examples.
Suggestion, implement Into<chrono::FixedOffset> for chrono_tz::Tz to bridge both structs, thereby reducing the generic code over chrono::TimeZone.
Parsing offsets of the form
+01:00
can be done withchrono
alone. Parsing any other timezone must be done withchrono-tz
.When we want to support the former, and optionally (i.e. via a feature gate) support the latter, it would be very useful to be able to convert
chrono_tz::Tz
tochrono::FixedOffset
because it avoids having to write a generic for it.The example code:
where
chrono_tz_utf_to_timestamp_ns
:and
this code would be much simpler if
utf8_to_timestamp_ns_impl
was not a generic. This is a simple example, but I find myself writing more complex examples.Suggestion, implement
Into<chrono::FixedOffset> for chrono_tz::Tz
to bridge both structs, thereby reducing the generic code overchrono::TimeZone
.