dtt

Macro dtt_diff_days

Source
macro_rules! dtt_diff_days {
    ($dt1:expr, $dt2:expr) => { ... };
}
Expand description

Calculates the difference in days between two DateTime instances.

§Arguments

  • $dt1:expr: The first DateTime instance.
  • $dt2:expr: The second DateTime instance.

§Example

use dtt::dtt_diff_days;
use dtt::dtt_diff;

let dt1 = "1609459200"; // 2021-01-01 00:00:00 UTC
let dt2 = "1609545600"; // 2021-01-02 00:00:00 UTC
let days_difference = dtt_diff_days!(dt1, dt2);
assert_eq!(days_difference, 1i64);