kcode-k1-ktool-current-time 0.1.0

Current UTC time Ktool for K1
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use chrono::{DateTime, SecondsFormat, Utc};

pub fn current_time() -> String {
    format_time(Utc::now())
}

fn format_time(time: DateTime<Utc>) -> String {
    time.to_rfc3339_opts(SecondsFormat::Millis, true)
}

#[cfg(test)]
mod tests;