How can I convert a CompoundPeriod type object to Period type in Julia?

Another way, which does not use floating-point numbers, is the following:

julia> c = Hour(3) + Minute(12)
3 hours, 12 minutes

julia> sum(Second, c.periods)
11520 seconds
3 Likes