pub fn diff_seconds(dt1: DateTime<Utc>, dt2: DateTime<Utc>) -> i64Expand description
Calculate the difference between two UTC times in seconds
§Parameters
dt1: First UTC datetimedt2: Second UTC datetime
§Returns
Number of seconds between two times (dt2 - dt1)
§Examples
let time1 = Utc::now();
// Some operations
let time2 = Utc::now();
let seconds_diff = diff_seconds(time1, time2);§Notes
- Return value can be positive or negative depending on time order
- Precise to the second level