# \`Type(val)\` vs \`convert(Type, val)\` (Converting more than 365 days to months and years)

**URL:** <https://discourse.julialang.org/t/type-val-vs-convert-type-val-converting-more-than-365-days-to-months-and-years/105684>\
**Category:** General Usage\
**Tags:** dates, time, convert\
**Created:** [November 2, 2023, 10:15am UTC](https://discourse.julialang.org/t/type-val-vs-convert-type-val-converting-more-than-365-days-to-months-and-years/105684 "2023-11-02T10:15:24Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 3, 2023, 8:03am UTC](https://discourse.julialang.org/t/type-val-vs-convert-type-val-converting-more-than-365-days-to-months-and-years/105684/13 "2023-11-03T08:03:46Z")

</div>

> [@TheLateKronos](#):
>
> how many years [months, days, h, min, s, μs] between two events

Here is [a solution to this problem that calls Python packages](https://discourse.julialang.org/t/how-to-decompose-a-dateperiod-or-timeperiod-in-tuple-of-y-m-d-h-m-s-s/74929/4).

At the time I looked at this, I could not find equivalent code in Julia.

---

_[View the full topic](https://discourse.julialang.org/t/type-val-vs-convert-type-val-converting-more-than-365-days-to-months-and-years/105684)._
