1use chrono::{DateTime, Local, Utc};
2use time::format_description::well_known::Iso8601;
3use time::OffsetDateTime;
4
5pub fn get_formatted_time() -> String {
7 let now = Utc::now();
8 let local_time: DateTime<Local> = now.with_timezone(&Local); local_time.format("%a %b %d %H:%M:%S %Y").to_string() }
11pub fn get_time() -> DateTime<Local> {
13 let now = Utc::now();
14 now.with_timezone(&Local) }
16
17pub fn get_time_iso() -> Result<String, Box<dyn std::error::Error>> {
19 let local = OffsetDateTime::now_local()?;
21 Ok(local.format(&Iso8601::DEFAULT)?)
22}