First, it adds a new
jiff::fmt::DateTimePrinter::print_timestamp_with_offset routine for
formatting a jiff::Timestamp as an RFC 3339 string with a specific
offset. In particular, this draws a contrast between the existing
print_timestamp method which will always use Zulu time. (Zulu is UTC,
but where the offset is unknown.)
Secondly, we add new helper methods on the datetime and span printers
to format datetimes and spans directly into a string. This is just
for convenience, since otherwise creating a String and passing
it in as a buffer can be a bit annoying. Also, since it's fixed to
a String, these methods are infallible and can never fail, which
further simplifies their use.
This PR does a couple things.
First, it adds a new
jiff::fmt::DateTimePrinter::print_timestamp_with_offset
routine for formatting ajiff::Timestamp
as an RFC 3339 string with a specific offset. In particular, this draws a contrast between the existingprint_timestamp
method which will always use Zulu time. (Zulu is UTC, but where the offset is unknown.)Secondly, we add new helper methods on the datetime and span printers to format datetimes and spans directly into a string. This is just for convenience, since otherwise creating a
String
and passing it in as a buffer can be a bit annoying. Also, since it's fixed to aString
, these methods are infallible and can never fail, which further simplifies their use.