Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Small function to verify validity of datetime (to use with
function isDateTimeValid(second, minute, hour, day, month, year)
function check(x, xmin, xmax)
return x >= xmin and x <= xmax
return check(second, 0, 59) and check(minute, 0, 59) and check(hour, 0, 23) and
check(day, 1, 31) and check(month, 1, 12) and check(year, 0, 99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment