Added is_valid function to datetimeutil classes