day <- 7
temp <- date.mdy(mdy.date(month = 7, day = day, year = 1960))
## Check for illegal dates, such as 29 Feb in a non leap year
if (temp$day != day) {
cat("Some illegal dates
")
} else {
cat("All days are legal
")
}
Run the code above in your browser using DataLab