dates
should preferably be a date
, Date
or IDate
object,
although they can also be character strings in a format
specified by format
(passed to as.Date
).When year.length = 'actual'
, fractional years are calculated as
year + day_in_year/365
for non-leap-years
and as year + day_in_year/366
for leap years.
If year.length = 'approx'
, fractional years are always
calculated as in year + day_in_year/365.242199
.
There is a slight difference, then, between the two methods
when calculating durations between fractional years. For
meticulous accuracy one might instead want to calculate durations using
dates (days) and convert the results to fractional years.
Note that dates are effectively converted to fractional years at
00:00:01
o'clock:
get.yrs("2000-01-01") = 2000
, and
get.yrs("2000-01-02") = 2000 + 1/365.242199
.