dtt

Macro dtt_add_days

Source
macro_rules! dtt_add_days {
    ($date:expr, $days:expr) => { ... };
}
Expand description

Adds the specified number of days to the given DateTime instance.

§Arguments

  • $date:expr: The DateTime instance.
  • $days:expr: The number of days to be added.

§Example

use dtt::{dtt_add_days, dtt_parse};

let dt = dtt_parse!("2023-01-01T12:00:00+00:00").unwrap();
let future_date = dtt_add_days!(dt, 5).unwrap();
assert_eq!(future_date.day(), 6);