-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1eb59dd
commit 9ebc134
Showing
7 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use chrono::{ | ||
naive::NaiveTime, | ||
offset::{Local, Utc}, | ||
}; | ||
use dateparser::parse_with; | ||
use std::error::Error; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
let parsed_in_local = parse_with("2021-10-09", &Local, NaiveTime::from_hms(0, 0, 0))?; | ||
println!("{:#?}", parsed_in_local); | ||
|
||
let parsed_in_utc = parse_with("2021-10-09", &Utc, NaiveTime::from_hms(0, 0, 0))?; | ||
println!("{:#?}", parsed_in_utc); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use chrono::offset::{Local, Utc}; | ||
use chrono_tz::US::Pacific; | ||
use dateparser::parse_with_timezone; | ||
use std::error::Error; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
let parsed_in_local = parse_with_timezone("6:15pm", &Local)?; | ||
println!("{:#?}", parsed_in_local); | ||
|
||
let parsed_in_utc = parse_with_timezone("6:15pm", &Utc)?; | ||
println!("{:#?}", parsed_in_utc); | ||
|
||
let parsed_in_pacific = parse_with_timezone("6:15pm", &Pacific)?; | ||
println!("{:#?}", parsed_in_pacific); | ||
|
||
Ok(()) | ||
} |