First working rescheduling
This commit is contained in:
parent
adc6b7866a
commit
b25857f3af
7 changed files with 85 additions and 20 deletions
10
src/util.rs
Normal file
10
src/util.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
pub fn time_to_jiff(t: time::OffsetDateTime) -> jiff::Zoned {
|
||||
let tz = jiff::tz::TimeZone::fixed(jiff::tz::offset(t.offset().whole_hours()));
|
||||
|
||||
jiff::Timestamp::new(t.unix_timestamp(), 0).unwrap()
|
||||
.to_zoned(tz)
|
||||
}
|
||||
|
||||
pub fn jiff_to_time(t: &jiff::Zoned) -> time::OffsetDateTime {
|
||||
time::OffsetDateTime::from_unix_timestamp(t.timestamp().as_second()).unwrap()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue