YearsBetween
Computes the approximate number of years between two points in time.
Syntax
-
YearsBetween(t, s)
-
t
ands
are datetime structures or timestamps
-
Description
If t
and s
are DateTime
structures or timestamps, then YearsBetween(t, s)
returns the (in general non-integral) approximate number of years between t
and s
, irrespective of the order of t
and s
, based on the assumption that one year is 365.25 days.
Examples
YearsBetween(date(1980, 05, 20), date(2000, 05, 20))
20