diff --git a/src/lib.rs b/src/lib.rs index 7edf7f6..826a6e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,10 @@ +#![allow(dead_code)] + extern crate chrono; use chrono::DateTime; use chrono::Datelike; +use chrono::FixedOffset; use chrono::Local; use chrono::NaiveDateTime; use chrono::NaiveTime; @@ -674,7 +677,7 @@ impl Parser { default: Option, ignoretz: bool, tzinfos: Vec, - ) -> Result, ParseError> { + ) -> Result, ParseError> { let now = Local::now().naive_local(); let default_date = default.unwrap_or(now).date(); @@ -708,16 +711,17 @@ impl Parser { dt: NaiveDateTime, res: &ParsingResult, default: NaiveDateTime, - ) -> DateTime { - Utc::now() + ) -> DateTime { + + Local::now().with_timezone(&FixedOffset::east(0)) } } -fn parse_with_info(timestr: String, info: ParserInfo) -> Result, ParseError> { +fn parse_with_info(timestr: String, info: ParserInfo) -> Result, ParseError> { let parser = Parser::new(info); parser.parse(timestr, None, false, vec![]) } -fn parse(timestr: String) -> Result, ParseError> { +fn parse(timestr: String) -> Result, ParseError> { parse_with_info(timestr, ParserInfo::default()) }