Operations with time duration

When dealing with calendar periods, which is what Dates is for, a period is a discrete indivisible unit. It doesn’t make sense to talk about “half a minute” because how do you add half a minute to the time 12:00:00? The answer is not 12:00:30 because a minute is sometimes 61 seconds long.

See Dates · The Julia Language for more detail.

You can use Unitful.jl though:

julia> using Unitful

julia> t = 1u"hr" + 5u"minute" + 2u"s"
3902 s

julia> t/5
780.4 s
3 Likes