def validate_date(year, month, day, hour, minute):
 valid = True
 if (year < 0):
  valid = False
 if ((month < 1) or (month > 12)):
  valid = False
 if ((day < 1) or (day > 31)):
  valid = False
 if ((hour < 0) or (hour > 23)):
  valid = False
 if ((minute < 0) or (minute > 59)):
  valid = False
 return valid

def validate_date ( year , month , day , hour , minute ) : valid = True if ( year < 0 ) : valid = False if ( ( month < 1 ) or ( month > 12 ) ) : valid = False if ( ( day < 1 ) or ( day > 31 ) ) : valid = False if ( ( hour < 0 ) or ( hour > 23 ) ) : valid = False if ( ( minute < 0 ) or ( minute > 59 ) ) : valid = False return valid
avoid corrupting db if bad dates come in .