We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be useful to have the functionality in Dates for parsing periods. E.g. getting an anser like
julia>parse(Dates.CompondPeriod, "00:15:00", periodformat"HH:MM:SS") 15 minutes
Or even
```julia julia>parse(Millisecond, "00:15:00", periodformat"HH:MM:SS") 900000 milliseconds
Having this kind of functionality for working with Periods would have been useful for JuliaLogging/LoggingExtras.jl#32
The text was updated successfully, but these errors were encountered:
parse(DateTime, x, dateformat"HH:MM:ss")
I mean, it's not pretty, but you can do: Dates.Millisecond(Dates.Nanosecond(Dates.value(Dates.Time("00:15:00", "HH:MM:SS"))))
Dates.Millisecond(Dates.Nanosecond(Dates.value(Dates.Time("00:15:00", "HH:MM:SS"))))
Sorry, something went wrong.
you can also do: parse(DateTime, "0:15:00", dateformat"HH:MM:SS") - DateTime(1) (note the 1 not 0 cf #38870)
parse(DateTime, "0:15:00", dateformat"HH:MM:SS") - DateTime(1)
1
0
While I haven't seen it used much, there is also an ISO 8601 format for representing durations / periods: https://en.wikipedia.org/wiki/ISO_8601#Durations.
No branches or pull requests
It would be useful to have the functionality in Dates for parsing periods.
E.g. getting an anser like
Or even
Having this kind of functionality for working with Periods would have been useful for
JuliaLogging/LoggingExtras.jl#32
The text was updated successfully, but these errors were encountered: