flags complete
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -106,9 +106,15 @@ fn log(f: &String, since: &Option<String>) -> Result<(), String> {
|
|||||||
fn parse_time(since: &Option<String>) -> Result<SystemTime, String> {
|
fn parse_time(since: &Option<String>) -> Result<SystemTime, String> {
|
||||||
match since {
|
match since {
|
||||||
Some(since) => {
|
Some(since) => {
|
||||||
match DateTime::parse_from_str(since, "%Y-%m-%d") {
|
match chrono::NaiveDate::parse_from_str(since, "%Y-%m-%d") {
|
||||||
Ok(dt) => {
|
Ok(dt) => {
|
||||||
Err("not impl".to_string())
|
Ok(UNIX_EPOCH.add(
|
||||||
|
Duration::from_secs(
|
||||||
|
dt.and_hms_opt(1, 1, 1)
|
||||||
|
.unwrap()
|
||||||
|
.timestamp() as u64
|
||||||
|
)
|
||||||
|
))
|
||||||
},
|
},
|
||||||
Err(msg) => Err(format!("failed to parse {}: {}", since, msg)),
|
Err(msg) => Err(format!("failed to parse {}: {}", since, msg)),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user