num-chrono-duration 0.1.0

Provide a convenient way to create `chrono::Duration` from numbers.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented9 out of 10 items with examples
  • Size
  • Source code size: 5.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 285.54 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ya7010/num-chrono-duration
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ya7010

num-chrono-duration

This crate provides a convenient way to create chrono::Duration from numbers.

Example:

use num_chrono_duration::NumChronoDuration;

let today = chrono::Utc::today();
assert_eq!(today + 1.hours(), today + chrono::Duration::hours(1));
assert_eq!(today + 1.days(), today + chrono::Duration::days(1));
assert_eq!(today - 1.weeks(), today - chrono::Duration::weeks(1));

Usage

To use num-chrono-duration, add this to your Cargo.toml:

[dependencies]
num-chrono-duration = "0.1.0"