mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-07-05 02:36:04 +08:00
更名文件夹objects->models,并增添index.rs结构
This commit is contained in:
@@ -34,6 +34,11 @@ pub fn get_storage_path() -> Result<String, std::io::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format_time(time: &std::time::SystemTime) -> String {
|
||||
let datetime: chrono::DateTime<chrono::Utc> = time.clone().into();
|
||||
datetime.format("%Y-%m-%d %H:%M:%S.%3f").to_string()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -49,4 +54,11 @@ mod tests {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_time() {
|
||||
let time = std::time::SystemTime::now();
|
||||
let formatted_time = format_time(&time);
|
||||
println!("{}", formatted_time);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user