Parses just date from date-time

        :return: Just day, month and year (setting hours to 00:00:00)
771483
def get_just_date(self):
        
        return datetime.datetime(
            self.date_time.year,
            self.date_time.month,
            self.date_time.day
        )
309668
def parse(
        self,
        time,  # type: str
        fmt,  # type: str
        now,  # type: pendulum.DateTime
        locale=None,  # type:  typing.Union[str, None]
    ):  # type: (...) -> dict
        
        escaped_fmt = re.escape(fmt)

        tokens = self._FROM_FORMAT_RE.findall(escaped_fmt)
        if not tokens:
            return time

        if not locale:
            locale = pendulum.get_locale()

        locale = Locale.load(locale)

        parsed = {
            "year": None,
            "month": None,
            "day": None,
            "hour": None,
            "minute": None,
            "second": None,
            "microsecond": None,
            "tz": None,
            "quarter": None,
            "day_of_week": None,
            "day_of_year": None,
            "meridiem": None,
            "timestamp": None,
        }

        pattern = self._FROM_FORMAT_RE.sub(
            lambda m: self._replace_tokens(m.group(0), locale), escaped_fmt
        )

        if not re.match(pattern, time):
            raise ValueError("String does not match format {}".format(fmt))

        re.sub(pattern, lambda m: self._get_parsed_values(m, parsed, locale, now), time)

        return self._check_parsed(parsed, now)
1266316
def datetime(
        self, year, month, day, hour=0, minute=0, second=0, microsecond=0
    ):  # type: (int, int, int, int, int, int, int) -> datetime
        
        if _HAS_FOLD:
            return self.convert(
                datetime(year, month, day, hour, minute, second, microsecond, fold=1)
            )

        return self.convert(
            datetime(year, month, day, hour, minute, second, microsecond),
            dst_rule=POST_TRANSITION,
        )
11857
def parse_datetime(s): #source: http://stackoverflow.com/questions/2211362/how-to-parse-xsddatetime-format
    """"""
    m = re.match(r""" ^
        (?P<year>-?[0-9]{4}) - (?P<month>[0-9]{2}) - (?P<day>[0-9]{2})
        T (?P<hour>[0-9]{2}) : (?P<minute>[0-9]{2}) : (?P<second>[0-9]{2})
        (?P<microsecond>\.[0-9]{1,6})?
        (?P<tz>
        Z | (?P<tz_hr>[-+][0-9]{2}) : (?P<tz_min>[0-9]{2})
        )?
        $ """, s, re.X)
    if m is not None:
        values = m.groupdict()
        #if values["tz"] in ("Z", None):
        #    tz = 0
        #else:
        #    tz = int(values["tz_hr"]) * 60 + int(values["tz_min"])
        if values["microsecond"] is None:
            values["microsecond"] = 0
        else:
            values["microsecond"] = values["microsecond"][1:]
            values["microsecond"] += "0" * (6 - len(values["microsecond"]))
        values = dict((k, int(v)) for k, v in values.items() if not k.startswith("tz"))
        try:
            return datetime(**values) # , tz
        except ValueError:
            pass
    return None
1037432
function parseTime(date, time) {
  let dateParts = date.split(' ')
  let mon = String(month.get(dateParts[1]))
  if (mon.length < 2) { mon = '0' + mon }
  let day = dateParts[0]
  if (day.length < 2) { day = '0' + day }
  return new Date(`${dateParts[2]}-${mon}-${day}T${time}${ukTz}`)
}
799388
def parse_date(value):
    
    if not value:
        return None

    if isinstance(value, datetime.date):
        return value

    return parse_datetime(value).date()
289993
def parse_date(s):
    
    if isinstance(s, (datetime.datetime, datetime.date)):
        return s
    try:
        from dateutil.parser import parse
    except ImportError:
        parse = lambda d: datetime.datetime.strptime(d, "%Y-%m-%d")
    return parse(s)
311688
def format_date(date):
        
        # Handle time typing
        try:
            date = date.isoformat()
        except AttributeError:  # Not a datetime object
            date = str(date)

        date = parser.parse(date).strftime('%Y-%m-%d')
        return date
111794
def parse_euro_date(self, date_string: str):
        
        self.date = datetime.strptime(date_string, "%d/%m/%Y")
        return self.date
948330
def parse_date(date_str):
    """"""
    if not date_str:
        return None

    try:
        date = ciso8601.parse_datetime(date_str)
        if not date:
            date = arrow.get(date_str).datetime
    except TypeError:
        date = arrow.get(date_str[0]).datetime
    return date
372967
def parse_datetime(text: str, date_format: str=None,
                   is_day_period: Optional[bool]=None,
                   datetime_now: datetime.datetime=None) \
        -> Tuple[datetime.datetime, int, int]:
    ''''''
    datetime_now = datetime_now or \
        datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
    year = datetime_now.year
    month = datetime_now.month
    day = datetime_now.day
    hour = 0
    minute = 0
    second = 0
    date_ok = False
    start_index = float('+inf')
    end_index = float('-inf')
    ambiguous_year = False

    text = unicodedata.normalize('NFKD', text).lower()

    # Let's do time first
    match = TIME_PATTERN.search(text)

    if match:
        hour_str = match.group(1)
        hour = int(hour_str)
        minute = int(match.group(2))
        day_period = match.group(4)

        if match.group(3):
            second = int(match.group(3))

        if day_period and is_day_period and hour < 13:
            if day_period.lower() in PM_STRINGS:
                if hour != 12:
                    hour += 12
            elif hour == 12:
                hour = 0

        start_index = match.start()
        end_index = match.end()

    # Now try dates
    if date_format == 'ymd' or not date_format:
        match = ISO_8601_DATE_PATTERN.search(text)
        if match:
            date_ok = True
            year = int(match.group(1))
            month = int(match.group(2))
            day = int(match.group(3))

            start_index = min(start_index, match.start())
            end_index = max(end_index, match.end())

    if not date_ok and (date_format == 'mdy' or not date_format):
        match = MMM_DD_YY_PATTERN.search(text)
        if match:
            date_ok = True
            month_str = match.group(1)
            month = parse_month(month_str)
            day = int(match.group(2))
            year_str = match.group(3)

            if year_str and len(year_str) == 4:
                year = int(year_str)
            else:
                ambiguous_year = True

            start_index = min(start_index, match.start())
            end_index = max(end_index, match.end())

    if not date_ok:
        match = NN_NN_NNNN_PATTERN.search(text)
        if match:
            date_ok = True
            num_1 = int(match.group(1))
            num_2 = int(match.group(2))
            year = int(match.group(3))

            if year < 100:
                year = y2k(year)

            if date_format == 'mdy' or num_2 > 12:
                month = num_1
                day = num_2
            else:
                day = num_1
                month = num_2

            start_index = min(start_index, match.start())
            end_index = max(end_index, match.end())

    if date_ok:
        guess_date = datetime.datetime(year, month, day, hour, minute, second,
                                       tzinfo=datetime.timezone.utc)

        if ambiguous_year and guess_date > datetime_now:
            # Sometimes year is not shown within 6 months
            # Year is shown for dates in the future
            guess_date = guess_date.replace(year=year - 1)

        return guess_date, start_index, end_index

    else:
        raise ValueError('Failed to parse date from {}'.format(repr(text)))
886975
def _parse_date(self, date_info: dict) -> Extraction or None:
        

        user_defined_pattern = None

        if date_info['pattern']:
            user_defined_pattern = re.findall(r'%[a-zA-Z]', date_info['pattern'])

        miss_day = miss_month = miss_year = miss_week = True

        i = 0
        pattern = list()
        formatted = list()

        for s in date_info['groups']:
            if s:
                p = self._symbol_list[date_info['order']][i] if not user_defined_pattern else user_defined_pattern[i]
                if p in units['D']:
                    miss_day = False
                elif p in units['M']:
                    miss_month = False
                elif p in units['Y']:
                    miss_year = False
                elif p in units['W']:
                    miss_week = False
                formatted_str = s.strip('.').strip().lower()
                if p in ['%B', '%b', '%A', '%a']:
                    if formatted_str in foreign_to_english:
                        # TODO: rearrange language detection in a better way
                        if self._lan == 'en':
                            continue
                        formatted_str = foreign_to_english[formatted_str]
                if p in ['%b', '%a']:
                    formatted_str = formatted_str[:3]
                formatted.append(re.sub(r'[^0-9+\-]', '', formatted_str) if p == '%z' else formatted_str)
                pattern.append(p)
            i += 1

        # TODO: deduplicate in the regex extraction part would be better
        exist, new_formatted, new_pattern = set(), [], []
        for i in range(len(pattern)):
            if pattern[i] not in exist:
                if re.match(r'[a-zA-Z]', formatted[i]) and pattern[i] == '%a':
                    miss_week = True
                else:
                    new_pattern.append(pattern[i])
                    new_formatted.append(formatted[i])
                    exist.add(pattern[i])
        formatted, pattern = new_formatted, new_pattern

        if formatted and pattern:
            try:
                if self._settings[DATE_VALUE_RESOLUTION] == DateResolution.ORIGINAL:
                    self._settings[MIN_RESOLUTION] = DateResolutionHelper.min_resolution(pattern)
                date = datetime.datetime.strptime('-'.join(formatted), '-'.join(pattern))
            except ValueError:
                try:
                    date = datetime.datetime.strptime('-'.join(formatted[:-1]), '-'.join(pattern[:-1]))
                except ValueError:
                    warn('DateExtractor: Failed to parse string to datetime object. \n'
                         'Patterns are not matched with string or the formats are not supported. ' +
                         '-'.join(formatted) + ' with ' + '-'.join(pattern))
                    return None

            if miss_year and miss_month and miss_day:
                today = datetime.datetime.now()
                if miss_week:
                    date = date.replace(day=today.day, month=today.month, year=today.year)
                else:
                    date = today
                    week_of_day = formatted[0].strip().lower()
                    if week_of_day in foreign_to_english:
                        week_of_day = foreign_to_english[week_of_day]
                    target = day_of_week_to_number[week_of_day] if week_of_day in day_of_week_to_number \
                        else today.weekday()
                    if self._settings[PREFER_DATES_FROM] == 'past':
                        date = date + relativedelta(days=-(date.weekday()+7-target)%7)
                    elif self._settings[PREFER_DATES_FROM] == 'future':
                        date = date + relativedelta(days=(target+7-date.weekday())%7)
                    else:
                        delta = target - date.weekday()
                        if abs(delta) <= 3:
                            date = date + relativedelta(days=delta)
                        else:
                            date = date + relativedelta(days=delta-7)

            else:
                if miss_day:
                    last = calendar.monthrange(date.year, date.month)[1]
                    if self._settings[PREFER_DAY_OF_MONTH] == 'current':
                        cur = datetime.datetime.now().day
                        date = date.replace(day=cur if cur <= last else last)
                    elif self._settings[PREFER_DAY_OF_MONTH] == 'last':
                        date = date.replace(day=last)

                if miss_year:
                    today = datetime.datetime.now()
                    date = date.replace(year=today.year)
                    next_year = date.replace(year=today.year+1)
                    last_year = date.replace(year=today.year-1)
                    if self._settings[PREFER_DATES_FROM] == 'past':
                        date = last_year if date > today else date
                    elif self._settings[PREFER_DATES_FROM] == 'future':
                        date = next_year if date < today else date
                    else:
                        if date > today and (date-today > today-last_year):
                            date = last_year
                        elif date < today and (today-date > next_year-today):
                            date = next_year

            date = self._post_process_date(date)

            if date:
                return self._wrap_extraction(date, date_info['value'], date_info['start'], date_info['end'])
        return None
545717
def dateparser(self, dformat='%d/%m/%Y'):
        

        def dateparse(dates):
            return [pd.datetime.strptime(d, dformat) for d in dates]

        return dateparse
1130145
def date(ctx, year, month, day):
    
    return _date(conversions.to_integer(year, ctx), conversions.to_integer(month, ctx), conversions.to_integer(day, ctx))
102178
def parse_datetime(dt):
    ''''''
    d = datetime.strptime(dt[:-1], ISOFORMAT)

    if dt[-1:] == 'Z':
        return timezone('utc').localize(d)
    else:
        return d
555898
def datetime(self):
        
        date_string = '%s %s %s' % (self._day,
                                    self._date,
                                    self._year)
        return datetime.strptime(date_string, '%a %B %d %Y')
1008944
def parse_date(value):
    
    # Do the regex magic; also enforces 2 or 4 digit years
    match = Definitions.DATE_RE.match(value) if value else None
    if not match:
        return None
    # We're going to extract and prepare captured data in 'data'.
    data = {}
    captured = match.groupdict()
    fields = ['year', 'month', 'day', 'hour', 'minute', 'second']
    # If we matched on the RFC 1123 family format
    if captured['year']:
        for field in fields:
            data[field] = captured[field]
    # If we matched on the asctime format, use year2 etc.
    else:
        for field in fields:
            data[field] = captured[field + "2"]
    year = data['year']
    # Interpret lame 2-digit years - base the cutoff on UNIX epoch, in case
    # someone sets a '70' cookie meaning 'distant past'. This won't break for
    # 58 years and people who use 2-digit years are asking for it anyway.
    if len(year) == 2:
        if int(year) < 70:
            year = "20" + year
        else:
            year = "19" + year
    year = int(year)
    # Clamp to [1900, 9999]: strftime has min 1900, datetime has max 9999
    data['year'] = max(1900, min(year, 9999))
    # Other things which are numbers should convert to integer
    for field in ['day', 'hour', 'minute', 'second']:
        if data[field] is None:
            data[field] = 0
        data[field] = int(data[field])
    # Look up the number datetime needs for the named month
    data['month'] = Definitions.month_numbers[data['month'].lower()]
    return datetime.datetime(**data)