using Dates
longPeriod = Date(2024,6,1) - Date(2022,1,20)
How can I decompose longPeriod (or a TimePeriod) in a tuple of (years,months,days,hours,minutes,seconds,milliseconds) ?
I know canLongPeriod = Dates.canonicalize(longPeriod) returns a CompoundPeriod object, but in terms of weeks and further, I don’t then know how to handle it.
But I guess the problem is complicated from the fact that 1 year or 1 month is not always the same number of days, so maybe my question doesn’t make much sense…
It’s not exactly what you were looking for but it’s entirely in Julia. It appears that it the largest unit it returns is weeks. I don’t know exactly why but my instant theory is that months and years aren’t fixed sizes absolutely.