yearfrac
Fraction of a year between two dates.
Syntax
Section titled “Syntax”v = yearfrac(start_date, end_date, basis)Description
Section titled “Description”Returns the years (with fractional part) between the dates. basis selects the day-count convention: 0 (US 30/360, default), 1 (actual/actual), 2 (actual/360), 3 (actual/365), 4 (European 30/360).
Example
Section titled “Example”yearfrac(date(2026,1,1), date(2026,7,1)) % 0.5