I have variable of type Dates.CompoundPeriod
I need to change it to String in format HH:MM:SS (value will never exceed 1 hour)
julia> x = Dates.CompoundPeriod(Dates.Hour(12), Dates.Minute(13))
12 hours, 13 minutes
julia> Dates.format(x, dateformat"HH:MM:SS")
ERROR: MethodError: no method matching format(::Dates.CompoundPeriod, ::DateFormat{Symbol("HH:MM:SS"),Tuple{Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'}}})
Closest candidates are:
format(::TimeType, ::DateFormat) at julia\stdlib\v1.5\Dates\src\io.jl:535
format(::TimeType, ::DateFormat, ::Any) at julia\stdlib\v1.5\Dates\src\io.jl:535
format(::Any, ::Dates.DatePart{'s'}, ::Any) at julia\stdlib\v1.5\Dates\src\io.jl:203
Is there any standard way to do this? Or do I have to parse string as
n1 hours, n2 minutes, n3 seconds
?
Thank you.