Determine the number of years between two dates

date_diff(date1, date2 = tidyged::date_current(), minimise = TRUE)

Arguments

date1

A date string from the tidyged object.

date2

A date string from the tidyged object. If no date is given, today's date is used.

minimise

If date ranges or periods are used in the dates, whether to choose the bounds which assume the minimum date difference. If this is FALSE, the maximum date difference is assumed.

Value

A numeric value giving the number of years. A numeric value less than zero means no determination could be made.

Details

Doesn't yet handle dual years or BCE dates.