diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-31 19:27:37 +0100 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-31 19:27:37 +0100 |
commit | f50129d61a65dd6372b3d12f42d989548fd666de (patch) | |
tree | 0f3b326c59066644d909be891df954c9e8c2ae95 /src/datetime.rs | |
parent | 4bbe0f98c06bd116d705b2f1a16b1d4f66b736d6 (diff) | |
download | rust_rrule-f50129d61a65dd6372b3d12f42d989548fd666de.zip |
refactor
Diffstat (limited to 'src/datetime.rs')
-rw-r--r-- | src/datetime.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/datetime.rs b/src/datetime.rs index 4702e0e..8099ad4 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -1,14 +1,9 @@ use chrono::prelude::*; -use chrono_tz::Tz; +use chrono::Utc; +use chrono_tz::{Tz}; pub type DTime = DateTime<Tz>; -// pub fn from_ordinal(ordinal: isize) -> DateTime<Utc> { -// let timestamp = ordinal * 24 * 60 * 60; -// let naive = NaiveDateTime::from_timestamp(timestamp as i64, 0); -// DateTime::from_utc(naive, Utc) -// } - pub fn from_ordinal(ordinal: isize, tz: &Tz) -> DTime { let timestamp = ordinal * 24 * 60 * 60; tz.timestamp(timestamp as i64, 0) |