date_valid_date(year,month,day)

From ENIGMA
Jump to navigation Jump to search

Description

Gets whether the given date is valid or not, for instance to make sure you haven't specified a day larger than the number of days in the month.

Parameters

Parameter Data Type Description
year integer year of the date-time value
month integer month of the date-time value
day integer day of the date-time value

Return Values

boolean: Returns whether the date is valid.

Example Call

// demonstrates checking if the date January 35th, 2001, is a valid date, it's not because there are not 35 days in January
if (date_valid_date(2001, 1, 35)) {
  // date is valid
} else {
  // this will most surely fire because the date is not valid
}