pub fn timestamp_to_string<S>(value: &f64, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    // exract integer part = number of seconds
    // frational part = number of nanoseconds
    let secs = value.trunc();
    let nanos = value.fract();
    let utc_tms = Utc.timestamp(secs as i64, (nanos * 1_000_000_000f64) as u32);
    format!("{}", utc_tms.format("%Y-%m-%d %H:%M:%S.%f")).serialize(serializer)
}
/// Converts the timestamp to a human readable string in the snapshot.
Converts the timestamp to a human readable string in the snapshot.
Converts the timestamp to a human readable string in the snapshot .
pub fn timestamp_to_string<S>(value: &f64, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    // exract integer part = number of seconds
    // frational part = number of nanoseconds
    let secs = value.trunc();
    let nanos = value.fract();
    let utc_tms = Utc.timestamp(secs as i64, (nanos * 1_000_000_000f64) as u32);
    format!("{}", utc_tms.format("%Y-%m-%d %H:%M:%S.%f")).serialize(serializer)
}
pub fn timestamp_to_string < S > ( value : & f64 , serializer : S ) -> Result < S :: Ok , S :: Error > where S : Serializer , { // exract integer part = number of seconds // frational part = number of nanoseconds let secs = value . trunc ( ) ; let nanos = value . fract ( ) ; let utc_tms = Utc . timestamp ( secs as i64 , ( nanos * 1_000_000_000f64 ) as u32 ) ; format ! ( " " utc_tms format ( " " ) ) . serialize ( serializer ) }
Converts the timestamp to a human readable string in the snapshot.
Converts the timestamp to a human readable string in the snapshot .
value
&f64
serializer
S
value
&f64
serializer
S