date_diff: Determine the number of years between two dates

View source: R/guess_age.R

date_diffR Documentation

Determine the number of years between two dates

Description

Determine the number of years between two dates

Usage

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.

Details

Doesn't yet handle dual years or BCE dates.

Value

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


jl5000/tidyged.utils documentation built on June 26, 2022, 4:40 p.m.