date: Adds support for datetime for parameter -d#5181
date: Adds support for datetime for parameter -d#5181philolo1 wants to merge 1 commit intouutils:mainfrom
Conversation
8d25370 to
c2e348e
Compare
|
Cool! I don't think we need 2 variants. Basically |
|
@tertsdiepraam thank you for your comment, would you recommend to change parse_datetime so it accepts relative time? I can do that, just want to confirm first. |
|
In theory yes, but there's a lot happening there already. Let's start here to get the issue fixed and look at getting that change to parse_datetime later. Does that sound good? |
|
@tertsdiepraam okay, so you want me to fix the comments by the bot for now only? |
|
Hmmm, actually you're right. I didn't think this through. Yes, parse_datetime should do both absolute and relative in one function. Sorry for the confusion :) |
|
@tertsdiepraam okay no problem. Thanks for clarification. |
bfcd05e to
bbf95cf
Compare
This resolved issue uutils#5177. The PR adds a new enum HumanDuration(Duration), HumanDateTime(DateTime<FixedOffset>) and uses parse_datetime::parse_datetime::from_str to support datetime if relative time cannot be parsed. Furthermore tests are added for tests/by-util/test_date.rs.
bbf95cf to
f95e42a
Compare
|
Looks like touch is failing because the new |
|
No activity for a while, closing! Feel free to reopen when ready |
This resolves issue #5177.
The PR adds a new enum HumanDuration(Duration), HumanDateTime(DateTime) and uses parse_datetime::parse_datetime::from_str to support datetime if relative time cannot be parsed.
For example we can now parse
date -d "@0",date -d "1992-02-12"anddate -d "2012-01-01 14:00".Furthermore tests are added for tests/by-util/test_date.rs.