]> git.lizzy.rs Git - rust.git/commit
auto merge of #9016 : sfackler/rust/nanoseconds, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 7 Sep 2013 05:25:59 +0000 (22:25 -0700)
committerbors <bors@rust-lang.org>
Sat, 7 Sep 2013 05:25:59 +0000 (22:25 -0700)
commit3e6de6b7da8ee88bf84b0e217900051334be08da
tree16fa08176d4ed0b64ad0462268952dd1713cec9a
parent25f3b29c61122bcf160d273348327723cd783419
parent3c30ecb706dc32257d1ec6bdcb0c88eb924483dd
auto merge of #9016 : sfackler/rust/nanoseconds, r=alexcrichton

The ISO 8601 standard does not mandate any specific precision for
fractional seconds, so this accepts input of any length, ignoring the
part after the nanoseconds place. It may be more correct to round with
the tenths of nanoseconds digit, but then we'd have to deal with
carrying the round through the entire Tm struct (e.g. for a time like
Dec 31 11:59.999999999999).

%f is the format specifier that Python's datetime library uses for
0-padded microseconds so it seemed appropriate here.

cc #2350