Skip to main content

kcode_k1_ktool_current_time/
lib.rs

1use chrono::{DateTime, SecondsFormat, Utc};
2
3pub fn current_time() -> String {
4    format_time(Utc::now())
5}
6
7fn format_time(time: DateTime<Utc>) -> String {
8    time.to_rfc3339_opts(SecondsFormat::Millis, true)
9}
10
11#[cfg(test)]
12mod tests;