Checks if the string `s` is a valid date string.

    Return True of False.
499328
def chk_date_arg(s):
    """"""
    if re_date.search(s) is None:
        return False
    comp = s.split('-')
    try:
        dt = datetime.date(int(comp[0]), int(comp[1]), int(comp[2]))
        return True
    except Exception as e:
        return False
524677
def is_time(self):
        """"""
        dt = DATA_TYPES['time']
        if type(self.data) is dt['type'] and ':' in str(self.data) and str(self.data).count(':') == 2:
            # Separate hour, month, second
            date_split = str(self.data).split(':')
            h, m, s = date_split[0], date_split[1], date_split[2]

            # Validate values
            valid_hour, valid_min, valid_sec = int(h) in HOURS, int(m) in MINUTES, int(float(s)) in SECONDS

            if all(i is True for i in (valid_hour, valid_min, valid_sec)):
                self.type = 'time'.upper()
                self.len = None
                return True
536354
function getValidDate (y, m, d, h, i, s, ms) {
  var date = new Date(y, m - 1, d, h, i, s, ms);
  if (
      y  === date.getFullYear()  &&
      m  === date.getMonth() + 1 &&
      d  === date.getDate()      &&
      h  === date.getHours()     &&
      i  === date.getMinutes()   &&
      s  === date.getSeconds()   &&
      ms === date.getMilliseconds()
  ) {
    return date;
  } else {
    return null;
  }
}
819371
def extract_date(cls, date_str):
        
        if not date_str:
            raise DateTimeFormatterException('date_str must a valid string {}.'.format(date_str))

        try:
            return cls._extract_timestamp(date_str, cls.DATE_FORMAT)
        except (TypeError, ValueError):
            raise DateTimeFormatterException('Invalid date string {}.'.format(date_str))
1275588
private boolean validFormat(final String s) {
        String[] args = ARGS_REGEX.split(s);
        if (noItems(args)) return false;
        if (args.length < 3) return false;

        // Check for the presence of a function name
        String name = args[0];
        if (name.isEmpty()) return false;
        if (!validFunction(name)) return false;

        // Check for the presence of a return type
        String returntype = args[args.length - 1];
        if (returntype.isEmpty()) return false;
        if (!validReturnType(returntype)) return false;

        // Check for zero or more arguments
        String arglist = args[1];
        if (arglist.isEmpty()) return true;

        // Split parameters on comma
        String[] argsplit = arglist.split(",");
        for (final String arg : argsplit) {
            if (!validParameter(arg)) return false;
        }
        return true;
    }
751963
def parse(self, s):
        
        return datetime.datetime.strptime(s, self.date_format).date()
3556
private function isValidFormat($date)
    {
        foreach ($this->formats as $format) {
            if (date($format, strtotime($date)) == $date) {
                return true;
            }
        }

        return false;
    }
314769
def _is_valid_date_time(self, inpt, metadata):
        """"""
        # NEED TO ADD CHECKS FOR OTHER METADATA, LIKE MINIMUM, MAXIMUM, ETC.
        from dlkit.abstract_osid.calendaring.primitives import DateTime as abc_datetime
        if isinstance(inpt, abc_datetime):
            return True
        else:
            return False
385511
public static boolean eventDateValid(String eventDate) {
    	boolean result = false; 
    	if (extractDate(eventDate)!=null) { 
    		result = true;
    	} else { 
    		Interval interval = extractInterval(eventDate);
    		if (interval!=null) { 
    			if (interval.getStart().isBefore(interval.getEnd())) { 
    			   result = true;
    			}
    		}
    	}
    	return result;
    }
972454
private static boolean isDate(String value) {
    try {
      new SimpleDateFormat("yyyyMMddHHmmss").parse(value);
      return true;
    } catch (ParseException e) {
      return false;
    }
  }
719104
def check_date_str_format(s, default_time="00:00:00"):
    """"""
    try:
        str_fmt = s
        if ":" not in s:
            str_fmt = '{} {}'.format(s, default_time)

        dt_obj = datetime.strptime(str_fmt, "%Y-%m-%d %H:%M:%S")

        return RET_OK, dt_obj

    except ValueError:
        error_str = ERROR_STR_PREFIX + "wrong time or time format"
        return RET_ERROR, error_str
1340455
def string_to_date(value):
    
    if isinstance(value, datetime.date):
        return value

    return dateutil.parser.parse(value).date()
1065781
function stringDate(value) {
    //  Empty string
    if (!value.length)
        return false;
    //  MM.DD.YYYY. - format
    //  valid separators -> . , / - \s
    if (value.search(/[.,/\\-]/g) > -1) {
        var date = value.split(/[.,/-\s]/g);
        var month = +date[0];
        var day = +date[1];
        var isValid = void 0;
        for (var _i = 0, months_2 = months_1.months; _i < months_2.length; _i++) {
            var _month = months_2[_i];
            (_month.ord >= month && _month.days >= day) ? isValid = true : isValid = false;
        }
        return isValid ? !isNaN(Date.parse(value)) : false;
    }
    //  YYYY-MM-DDTTT:HH:MM.SSSZ - format
    return !isNaN(Date.parse(value));
}
241579
@CheckForNull
  public static Date parseDateTimeQuietly(@Nullable String s) {
    Date datetime = null;
    if (s != null) {
      try {
        datetime = parseDateTime(s);
      } catch (RuntimeException e) {
        // ignore
      }

    }
    return datetime;
  }
1098965
@Deprecated
	public static boolean isValidDate(String date) {
		try {
			convertStringDateToTime(date);
			return true;
		} catch (IllegalArgumentException err) {
			return false;
		}
	}
812202
public static  boolean isDate(String str) {  
    	try {
    		DateUtils.parseDate(str);
    		return true;
		} catch (Exception e) {
			return false;
		}
    }
99316
def isValid(self):
        

        today = DateTime()
        valid_from = self.getValidFrom()
        valid_to = self.getValidTo()

        return valid_from <= today <= valid_to