Duration & Calendar Duration. What is the difference?
Show older comments
Still, I can't understand the difference.
Piece of code which exemplifies my doubt:

I added exactly 1 year to t0, using years and calyears, and I get different answers.
1 Comment
From the duration documentation: "..fixed-length (365.2425-day long) years."
From the calendar duration documentation: "..elapsed time in calendar units of variable length. For example, the number of days in 1 month depend on the particular month of the year. Calculations with calendar durations account for daylight saving time changes and leap years"
So duration has a fixed year length, and calendar duration the year length changes with leap years, etc.
Accepted Answer
More Answers (0)
Categories
Find more on Calendar in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!