Open fdncred opened 1 week ago
%c
is probably a no-go if its specification is "the default format for the current locale." Jiff is very intentionally locale-unaware. I'm not sure if Chrono is even doing the right thing there. It would be better to use icu
for that.
I am unsure about %+
because I'm not sure I want to encourage that format over RFC 9557 more than it already is. Moreover, it's unclear to me why you would use that when a Timestamp
's default Display
impl is exactly that: RFC 3339.
Moreover, it's unclear to me why...
Because I'm writing a nushell command to format dates where dt format <specifier>
allows user to print the datetime in the format they specify and, it's more convenient to have specifiers that print the datetime with 2 characters rather than 10, or however many it would take. I can, of course, hard code custom specifiers and parse them in my code if you're not willing to add these.
I'll noodle on that, but I think there may be an impedance mismatch here. The needs of a strtime DSL at the library level are likely somewhat different than the needs at a user facing CLI level. I'm still unsure of this because I want to be very careful about encouraging more offset-only formatting.
The notable missing format specifiers from chrono, that I use pretty frequently, are:
They're really just convenience formatters, but they're pretty convenient. 😄