1 stable release
1.0.0 | Sep 19, 2023 |
---|
#388 in Date and time
23 downloads per month
16KB
319 lines
calendar-duration
A Rust library containing a calendar respecting duration that is compatible with the time
crate.
Supports parsing and displaying to/from strings. Also supports addition and subtraction with OffsetDateTime
.
Usage
Add the following dependency:
calendar-duration = "<latest version>"
See documentation for details.
Time string syntax
y
for yearsmon
for monthsw
for weeksd
for daysh
for hoursm
for minutess
for seconds
The string can be prefixed with -
for negative durations.
Examples
1y3mon4d
-3w4m5s
Dependencies
~735KB
~13K SLoC