On the other hand, years adds a fixed interval representing an average length year of 365.2425 days, which is 365 days, 5 hours, 49 min and 12 sec.
>> t17 + years(1) ans = 01-Mar-2018 05:49:12
>> t19 + years(1) ans = 29-Feb-2020 05:49:12
2018 is not a leap year, so in the first case you end up advanced 5 hr 49 min 12 sec into March 1st 2018. But 2020is a leap year, so in the second case you are 18 hr 10 min 48 sec short of making it into March 1st 2020.
For some reason Matlab uses 365.2425 days whereas most of the sources on the web cite something like 365.24217.
Best Answer