Add REST endpoint for slot
This commit is contained in:
parent
82e89baeeb
commit
8f378472ea
28 changed files with 1925 additions and 28 deletions
16
service_impl/src/clock.rs
Normal file
16
service_impl/src/clock.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use service::clock::ClockService;
|
||||
use time::OffsetDateTime;
|
||||
|
||||
pub struct ClockServiceImpl;
|
||||
impl ClockService for ClockServiceImpl {
|
||||
fn time_now(&self) -> time::Time {
|
||||
OffsetDateTime::now_utc().time()
|
||||
}
|
||||
fn date_now(&self) -> time::Date {
|
||||
OffsetDateTime::now_utc().date()
|
||||
}
|
||||
fn date_time_now(&self) -> time::PrimitiveDateTime {
|
||||
let now = OffsetDateTime::now_utc();
|
||||
time::PrimitiveDateTime::new(now.date(), now.time())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue