powered by
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)
Date.mdy(date)
is.Date(x)
integer, month (1-12).
integer, day of the month (1-31, depending on the month).
integer, either 2- or 4-digit year. If two-digit number, will add 1900 onto it, depending on range.
cutoff for method to know if to convert to 4-digit year.
A date value.
An object.
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.
mdy.Date
is.Date
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.
Date, DateTimeClasses
Date
DateTimeClasses
# NOT RUN { mdy.Date(9, 2, 2013) tmp <- mdy.Date(9, 2, 2013) Date.mdy(tmp) is.Date(tmp) # }
Run the code above in your browser using DataLab