pub fn to_approximate_datetime(instant: Instant) -> DateTime<Utc> {
    let (ref_date, ref_instant) = *INSTANCE.get_or_init(|| (Utc::now(), Instant::now()));

    if ref_instant > instant {
        ref_date
            - chrono::Duration::from_std(ref_instant.duration_since(instant))
                .expect("date overflow")
    } else {
        ref_date
            + chrono::Duration::from_std(instant.duration_since(ref_instant))
                .expect("date overflow")
    }
}
/// Provides a conversion from Instant to DateTime<Utc> for display purposes
///
/// It is an approximation as if the system clock changes, the returned DateTime will not be
/// the same as the DateTime that would have been recorded at the time the Instant was created.
///
/// The conversion does, however, preserve the monotonic property of Instant, i.e. a larger
/// Instant will have a larger returned DateTime.
///
/// This should ONLY be used for display purposes, the results should not be used to
/// drive logic, nor persisted
Provides a conversion from Instant to DateTime for display purposes
It is an approximation as if the system clock changes, the returned DateTime will not be
the same as the DateTime that would have been recorded at the time the Instant was created.

The conversion does, however, preserve the monotonic property of Instant, i.e. a larger
Instant will have a larger returned DateTime.

This should ONLY be used for display purposes, the results should not be used to
drive logic, nor persisted
Provides a conversion from Instant to DateTime for display purposes It is an approximation as if the system clock changes the returned DateTime will not be the same as the DateTime that would have been recorded at the time the Instant was created . The conversion does however preserve the monotonic property of Instant i . e . a larger Instant will have a larger returned DateTime . This should ONLY be used for display purposes the results should not be used to drive logic nor persisted
pub fn to_approximate_datetime(instant: Instant) -> DateTime<Utc> {
    let (ref_date, ref_instant) = *INSTANCE.get_or_init(|| (Utc::now(), Instant::now()));
    if ref_instant > instant {
        ref_date
            - chrono::Duration::from_std(ref_instant.duration_since(instant))
                .expect("date overflow")
    } else {
        ref_date
            + chrono::Duration::from_std(instant.duration_since(ref_instant))
                .expect("date overflow")
    }
}
pub fn to_approximate_datetime ( instant : Instant ) -> DateTime < Utc > { let ( ref_date , ref_instant ) = * INSTANCE . get_or_init ( | | ( Utc :: now ( ) , Instant :: now ( ) ) ) ; if ref_instant > instant { ref_date - chrono :: Duration :: from_std ( ref_instant . duration_since ( instant ) ) . expect ( " " ) } else { ref_date + chrono :: Duration :: from_std ( instant . duration_since ( ref_instant ) ) . expect ( " " ) } }
Provides a conversion from Instant to DateTime<Utc> for display purposes
It is an approximation as if the system clock changes, the returned DateTime will not be
the same as the DateTime that would have been recorded at the time the Instant was created.
Provides a conversion from Instant to DateTime<Utc > for display purposes It is an approximation as if the system clock changes the returned DateTime will not be the same as the DateTime that would have been recorded at the time the Instant was created .
instant
Instant
instant
Instant