date_valid_time(hour,minute,second)

From ENIGMA
Jump to navigation Jump to search

Description

Gets whether the given time is valid or not, for instance to make sure you haven't specified a second larger than the number of seconds in a minute.

Parameters

Parameter Data Type Description
hour integer hour of the date-time value
minute integer minute of the date-time value
second integer second of the date-time value

Return Values

boolean: Returns whether the time is valid.

Example Call

// demonstrates checking if the time 12:35:61, is a valid time, it's not because there are only 60 seconds in a minute
if (date_valid_date(12,35,61)) {
  // date is valid
} else {
  // this will most surely fire because the time is not valid
}