# Using time (minutes, seconds) to calculate duration of events

**URL:** https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624
**Category:** General Usage
**Created:** [September 6, 2018, 2:25pm UTC](https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624 "2018-09-06T14:25:06Z")
**Posts on this page:** 1
**Showing post:** 18

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [September 7, 2018, 4:11pm UTC](https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624/18 "2018-09-07T16:11:47Z")

</div>

> [@stephancb](#):
>
> It would be nicer not having to add a DateTime, to get a segmented period (days, hours, …).

```julia
julia> canonicalize(Dates.CompoundPeriod((Second(Minute(32))+Second(45))/5))
6 minutes, 33 seconds

```

---

_[View the full topic](https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624)._
