This is a library that formats/parses datetime of the time crate with somewhat more strftime
/strptime
-compatible format specification.
strftime
-like function.
%C
, %d
, %D
, %e
, %F
, %g
, %G
, %h
, %H
, %I
, %j
, %k
, %l
, %m
, %M
, %n
, %R
, %S
, %t
, %T
, %u
, %U
, %V
, %w
, %W
, %y
, %Y
, %%
.%a
, %A
, %b
, %B
, %c
, %p
, %P
, %r
, %x
, %X
.%z
, %Z
.strptime
-like function.
%C
, %d
, %D
, %e
, %F
, %h
, %H
, %I
, %j
, %k
, %l
, %m
, %M
, %n
, %R
, %S
, %t
, %T
, %W
, %y
, %Y
, %%
.%b
, %B
, %c
, %p
, %P
, %r
, %x
, %X
%z
, %Z
.%a
, %A
, %U
, %w
.strftime
-like conversion specification to Vec<FormatItem>
of the time crate.Vec<FormatItem>
instead.%E*
and %O*
should be implemented as if it were in the C/POSIX locale; i.e. fall back to the normal ones.C
, F
, G
, Y
) and flags (0
, +
).strftime
-like ones
nl_langinfo
lookups, namely %a
, %A
, %b
, %h
, %B
, %c
, %p
, %P
, %r
, %x
, and %X
are not implemented to do so. Instead, they are hardcoded to use that of C/POSIX locale.%E
are unsupported.%O
are unsupported.%z
doesn't work if you passed PrimitiveDateTime
. It'll be substituted to the empty string, as if "no time zone is determinable".%Z
works only if you have timezone_name
feature flag enabled, and passed PrimitiveDateTime
+ Tz
. Otherwise substituted to the empty string, as if "no time zone is determinable".%
followed by a character that doesn't compose a conversion specifier that we support will result into an error.strptime
-like ones
%a
, %A
, %U
, and %w
are matched to the input but ignored.struct tm
of C language, inconsistent input will result in an unspecified behavior.Result::Err
in a future release without bumping the major version.Vec<FormatItem>
%C
(century) and %Z
(timezone name) are unsupported as no corresponding FormatItem
exists.Note for myself.
shell
$ git swithc master # make sure you're on the master branch
$ cargo release patch # to dry-run the release
$ cargo release patch --execute # to actually execute the release
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.