Created
February 11, 2020 19:23
-
-
Save tupshin/1cc506a99e9189ed1b604461619d12ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use openfmb_ops_protobuf::openfmb::commonmodule; | |
fn get_current_datetime() -> Timestamp { | |
let t = Utc::now(); | |
let tq = commonmodule::TimeQuality { | |
clock_failure: false, | |
clock_not_synchronized: false, | |
leap_seconds_known: true, | |
time_accuracy: commonmodule::TimeAccuracyKind::Unspecified as i32, | |
}; | |
commonmodule::Timestamp { | |
fraction: (t.timestamp_subsec_nanos() as f64 / ((1000000000 as f64) * (2u32.pow(32) as f64) as f64)) as u32, | |
seconds: t.timestamp() as u64, | |
tq: Some(tq), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment