-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time.ParseDuration day, week, month, year -> d, w, M, Y; helper code to ParseDuration #69114
Comments
Thanks, but we intentionally do not use any time unit larger than hour because they are ambiguous. Days are sometimes 24 hours, sometimes 23 or 25 at daylight savings time transitions. Similarly for the other larger units. |
I understand the reasoning, but it does look a bit unpractical when used with flag.Duration, i.e. with a 30 day default: -whiteexp duration
duration before whitelists expire (default 720h0m0s) From poolpOrg/filter-spfgreylist#5 Maybe we should adapt flag.Duration (not time.Duration) to parse days when used as input from the command line? |
I didnt get you |
Sorry, I was replying to ianlancetaylor.
It's nice, although I would prefer to copy paste if it's just a little bit of code. For me just adding days and weeks would help with flags to command line tools and it's less ambiguous than the length of a month. |
I just copied code from org time pkg and added some flexibility |
I've simplified the code to make it easier to copy and use.
also same issue[/issues/17767#issue-187078548]
The text was updated successfully, but these errors were encountered: