macro_rules! dtt_sub_days {
($date:expr, $days:expr) => { ... };
}
Expand description
Subtracts the specified number of days from the given DateTime
instance.
§Arguments
$date:expr
: TheDateTime
instance.$days:expr
: The number of days to be subtracted.
§Example
use dtt::{dtt_sub_days, dtt_parse};
let dt = dtt_parse!("2023-01-06T12:00:00+00:00").unwrap();
let past_date = dtt_sub_days!(dt, 5).unwrap();
assert_eq!(past_date.day(), 1);