use chrono::{Local, Utc};
use crate::domain::model::temporal::iso_date::IsoDate;
use crate::domain::model::temporal::timestamp::Timestamp;
use crate::domain::usecases::clock::Clock;
pub struct SystemClock;
impl Clock for SystemClock {
fn now(&self) -> Timestamp {
Timestamp::new(&Utc::now().format("%Y-%m-%dT%H:%M:%SZ").to_string())
.expect("UTC::now formatted with %Y-%m-%dT%H:%M:%SZ is always a valid Timestamp")
}
fn today_local(&self) -> IsoDate {
IsoDate::new(&Local::now().format("%Y-%m-%d").to_string())
.expect("Local::now formatted with %Y-%m-%d is always a valid IsoDate")
}
}