Check if the string contains Date.UTC function 
        and return match group(s) if there is
422331
def is_js_date_utc(json):
        
        
        JS_date_utc_pattern = r'Date\.UTC\(([0-9]+,[0-9]+,[0-9]+)(,[0-9]+,[0-9]+,[0-9]+)?(,[0-9]+)?\)'
        re_date = re.compile(JS_date_utc_pattern, re.M)

        if re_date.search(json):
            return re_date.search(json).group(0)
        else:
            return False
1035531
def from_utc(utcTime, fmt=None):
    """"""
    if fmt is None:
        try_formats = ["%Y-%m-%d %H:%M:%S.%f", "%Y-%m-%d %H:%M:%S"]
    else:
        try_formats = [fmt]

    for fmt in try_formats:
        try:
            time_struct = datetime.datetime.strptime(utcTime, fmt)
        except ValueError:
            pass
        else:
            date = int(time.mktime(time_struct.timetuple()))
            return date
    else:
        raise ValueError("No UTC format matches {}".format(utcTime))
178986
function compareTimeZones(a, b) {
    if (typeof a !== 'string' || typeof b !== 'string') {
      return NaN;
    }

    return normalizeIso8601TimeZone(a) - normalizeIso8601TimeZone(b);
  }
1186833
function isDateType(value) {
    if (value) {
        var str = value.toString();
        return moment(new Date(value), "YYYY-M-D", true).isValid() || moment(value, "YYYY-M-D H:m:s", true).isValid() || moment(value, "YYYY/M/D H:m:s", true).isValid() || moment(value, "YYYY/M/D", true).isValid();
    };
    return false;
}
1000889
function parseDate(fmt, date) {
    var indexMap = {}; // contains reGroupPosition -> typeLetter or [typeLetter, value array]
    var reIndex = 1;
    var timezoneOffsetMatch;
    var timezoneIndex;
    var match;

    var format = replace(fmt, /^\?/);
    if (format!=fmt && !trim(date))
      return _null;

    if (match = /^\[([+-])(\d\d)(\d\d)\]\s*(.*)/.exec(format)) {
      timezoneOffsetMatch = match;
      format = match[4];
    }

    var parser = new RegExp(format.replace(/(.)(\1*)(?:\[([^\]]*)\])?/g, function(wholeMatch, placeholderChar, placeholderDigits, param) {
      if (/[dmhkyhs]/i.test(placeholderChar)) {
        indexMap[reIndex++] = placeholderChar;
        var plen = placeholderDigits.length+1;
        return "(\\d"+(plen<2?"+":("{1,"+plen+"}"))+")";
      }
      else if (placeholderChar == 'z') {
        timezoneIndex = reIndex;
        reIndex += 3;
        return "([+-])(\\d\\d)(\\d\\d)";
      }
      else if (/[Nna]/.test(placeholderChar)) {
        indexMap[reIndex++] = [placeholderChar, param && param.split(',')];
        return "([a-zA-Z\\u0080-\\u1fff]+)";
      }
      else if (/w/i.test(placeholderChar))
        return "[a-zA-Z\\u0080-\\u1fff]+";
      else if (/\s/.test(placeholderChar))
        return "\\s+";
      else
        return escapeRegExp(wholeMatch);
    }));

    if (!(match = parser.exec(date)))
      return undef;

    var ctorArgs = [0, 0, 0, 0, 0, 0,  0];
    for (var i = 1; i < reIndex; i++) {
      var matchVal = match[i];
      var indexEntry = indexMap[i];
      if (isList(indexEntry)) { // for a, n or N
        var placeholderChar = indexEntry[0];
        var mapEntry  = PARSE_DATE_MAP[placeholderChar];
        var ctorIndex = mapEntry[0];
        var valList = indexEntry[1] || mapEntry[1];
        var listValue = find(valList, function(v, index) { if (startsWith(matchVal.toLowerCase(), v.toLowerCase())) return index; });
        if (listValue == _null)
          return undef;
        if (placeholderChar == 'a')
          ctorArgs[ctorIndex] += listValue * 12;
        else
          ctorArgs[ctorIndex] = listValue;
      }
      else if (indexEntry) { // for numeric values (yHmMs)
        var value = parseFloat(matchVal);
        var mapEntry  = PARSE_DATE_MAP[indexEntry];
        if (isList(mapEntry))
          ctorArgs[mapEntry[0]] += value - mapEntry[1];
        else
          ctorArgs[mapEntry] += value;
      }
    }
    var d = new Date(ctorArgs[0], ctorArgs[1], ctorArgs[2], ctorArgs[3], ctorArgs[4], ctorArgs[5], ctorArgs[6]);
    return dateAdd(d, 'minutes', -getTimezone(timezoneOffsetMatch, 1, d) - getTimezone(match, timezoneIndex, d));
  }
146070
function matches(regex) {
	return function(val) {
		regex.lastIndex = 0;
		return isString(val) && regex.test(val);
	};
}
983141
function parse (dateString, locale, timezone) {
  _checkParams(locale, timezone)
  // list all available localized formats, from most specific to least
  return moment.tz(dateString, [moment.ISO_8601, 'llll', 'LLLL', 'lll', 'LLL', 'll', 'LL', 'l', 'L'], locale, timezone)
}
909003
def _get_partial_string_timestamp_match_key(self, key, labels):
        """"""
        if isinstance(labels, MultiIndex):
            if (isinstance(key, str) and labels.levels[0].is_all_dates):
                # Convert key '2016-01-01' to
                # ('2016-01-01'[, slice(None, None, None)]+)
                key = tuple([key] + [slice(None)] * (len(labels.levels) - 1))

            if isinstance(key, tuple):
                # Convert (..., '2016-01-01', ...) in tuple to
                # (..., slice('2016-01-01', '2016-01-01', None), ...)
                new_key = []
                for i, component in enumerate(key):
                    if (isinstance(component, str) and
                            labels.levels[i].is_all_dates):
                        new_key.append(slice(component, component, None))
                    else:
                        new_key.append(component)
                key = tuple(new_key)

        return key
599917
def easy_time_extrator(self, string):
        
        try:
            if not self.year_check and not self.month_check and not self.day_check:
                str_all = re.search('([\u4e00-\u9fa5〇○]{4})年([\u4e00-\u9fa5]{1,3})月([\u4e00-\u9fa5]{1,3})日', string)
                str_year = self.str_to_num(str_all.group(1))
                str_month = self.str_to_num(str_all.group(2))
                str_day = self.str_to_num(str_all.group(3))
                check_year = datetime.datetime.now().year
                if str_year in range(1970, check_year + 1) and str_month in range(1, 13) and str_day in range(1,
                                                                                                              32):
                    self.year = str_year
                    self.month = str_month
                    self.day = str_day
                    self.year_check = True
                    self.month_check = True
                    self.day_check = True
        except:
            pass
        try:
            if not self.year_check and not self.month_check and not self.day_check:
                str_all = re.search('(\d{4})[-._年](\d{1,2})[-._月](\d{1,2})', string)
                str_year = int(str_all.group(1))
                str_month = int(str_all.group(2))
                str_day = int(str_all.group(3))
                check_year = datetime.datetime.now().year
                if str_year in range(1970, check_year + 1) and str_month in range(1, 13) and str_day in range(1,
                                                                                                              32):
                    self.year = str_year
                    self.month = str_month
                    self.day = str_day
                    self.year_check = True
                    self.month_check = True
                    self.day_check = True
        except:
            pass
22800
def validate(self, obj, **kwargs):
        """"""
        obj = stringify(obj)
        if obj is None:
            return False
        return self.DATE_RE.match(obj) is not None
65061
function dateStrGetter(name, width, form, extended) {
    if (form === void 0) { form = FormStyle.Format; }
    if (extended === void 0) { extended = false; }
    return function (date, locale) {
        return getDateTranslation(date, locale, name, width, form, extended);
    };
}
436962
def match_date(self, value, strict=False):
        """"""
        value = stringify(value)
        try:
            parse(value)
        except Exception:
            self.shout('Value %r is not a valid date', strict, value)
387951
function validTimestamp(timestamp) {
    // ^year-month-day(Thour:min:secms?timezone)?$
    var year = /((?:[1-9][0-9]*)?[0-9]{4})/,
        month = /(1[0-2]|0[1-9])/,
        day = /(3[01]|0[1-9]|[12][0-9])/,
        hour = /(2[0-3]|[01][0-9])/,
        minute = /([0-5][0-9])/,
        second = /([0-5][0-9])/,
        ms = /(\.[0-9]+)/,
        timezone = /(Z|[+\-](?:2[0-3]|[01][0-9]):[0-5][0-9])/,
        date = [year.source, month.source, day.source].join('-'),
        time = [hour.source, minute.source, second.source].join(':'),
        timestampRegex,
        result;

    timestampRegex = new RegExp(
        '^' + date + '(T' + time + ms.source + '?' + timezone.source + ')?$'
    );

    result = timestampRegex.exec(timestamp);

    return result !== null;
}
983585
def date_from_string(string, format_string=None):
    """"""

    if isinstance(format_string, str):
        return datetime.datetime.strptime(string, format_string).date()

    elif format_string is None:
        format_string = [
            "%Y-%m-%d",
            "%m-%d-%Y",
            "%m/%d/%Y",
            "%d/%m/%Y",
        ]

    for format in format_string:
        try:
            return datetime.datetime.strptime(string, format).date()
        except ValueError:
            continue

    raise ValueError("Could not produce date from string: {}".format(string))
1206246
function isDateSame (date1, date2, format) {
  if (date1 && date2) {
    return toDateString(date1, format) === toDateString(date2, format)
  }
  return false
}
193756
def get_group_value(self, token, match):
        """"""
        try:
            value = match.group('{}_{}'.format(token.name, self.group))
        except IndexError:
            value = ''
        return self.func(value) if callable(self.func) else value
603643
def verify_utctz(offset):
    """"""
    fmt_exc = ValueError("Invalid timezone offset format: %s" % offset)
    if len(offset) != 5:
        raise fmt_exc
    if offset[0] not in "+-":
        raise fmt_exc
    if offset[1] not in digits or\
       offset[2] not in digits or\
       offset[3] not in digits or\
       offset[4] not in digits:
        raise fmt_exc
    # END for each char
    return offset