Convert numeric dates for month, day, and year to Date object, and vice versa.
mdy.Date(month, day, year, yearcut = 120)
Date.mdy(date)
is.Date(x)
mdy.Date
returns a Date object, and Date.mdy returns a list with integer values for month, day, and year.
is.Date
returns a single logical value.
Test if an object is a date.
More work may need to be done with yearcut and 2-digit years. Best to give a full 4-digit year.
mdy.Date(9, 2, 2013)
#> [1] "2013-09-02"
tmp <- mdy.Date(9, 2, 2013)
Date.mdy(tmp)
#> $month
#> [1] 9
#>
#> $day
#> [1] 2
#>
#> $year
#> [1] 2013
#>
is.Date(tmp)
#> [1] TRUE