Link Search Menu Expand Document

datedif

Explanation Returns the period from the start date to the end date.
The start and end date times are ignored.
Call format var y = datedif (start date, end date, output specification)
Return value Returns the difference between the end date and the start date with the specified output specification.
Arguments Date Start date Start date
Date End date End date
String output specification "y" years elapsed
"m" Number of months elapsed
"d" Elapsed days
"md" Fraction of days less than a month
"ym" Fraction of months less than a year
"yd" Fraction of days less than a year
Exception None
Example of use
var d1 = dateval("1964/8/10");
var d2 = sysdate();
var s = datedif(d1, d2, "y");
Related item