Return the textual representation of the given :class:`~taxi.timesheet.lines.DateLine` instance. The date
        format is set by the `date_format` parameter given when instanciating the parser instance.
2348
def date_line_to_text(self, date_line):
        
        # Changing the date in a dateline is not supported yet, but if it gets implemented someday this will need to be
        # changed
        if date_line._text is not None:
            return date_line._text
        else:
            return date_utils.unicode_strftime(date_line.date, self.date_format)
460741
def __date_format(self, x):
        

        if x < 1: x = 1

        span = self.axes.xaxis.get_view_interval()
        tmin = max(1.0, span[0])
        tmax = max(2.0, span[1])
        tmin = time.mktime(dates.num2date(tmin).timetuple())
        tmax = time.mktime(dates.num2date(tmax).timetuple())
        nhours = (tmax - tmin)/3600.0
        fmt = "%m/%d"
        if nhours < 0.1:
            fmt = "%H:%M\n%Ssec"
        elif nhours < 4:
            fmt = "%m/%d\n%H:%M"
        elif nhours < 24*8:
            fmt = "%m/%d\n%H:%M"
        try:
            return time.strftime(fmt, dates.num2date(x).timetuple())
        except:
            return "?"
137488
def QA_util_date_stamp(date):
    
    datestr = str(date)[0:10]
    date = time.mktime(time.strptime(datestr, '%Y-%m-%d'))
    return date
1169834
def parse(cls, date_string):
        
        try:
            date = dateparser.parse(date_string)
            if date.tzinfo is None:
                date = dateparser.parse(date_string, tzinfos=cls.tzd)
            return date
        except Exception:
            raise ValueError("Could not parse date string!")
855156
def format_datetime(date):
    
    # todo: test me
    if date.utcoffset() is None:
        return date.isoformat() + 'Z'

    utc_offset_sec = date.utcoffset()
    utc_date = date - utc_offset_sec
    utc_date_without_offset = utc_date.replace(tzinfo=None)
    return utc_date_without_offset.isoformat() + 'Z'
169637
def _parse(self, date_str, format='%Y-%m-%d'):
        
        rv = pd.to_datetime(date_str, format=format)
        if hasattr(rv, 'to_pydatetime'):
            rv = rv.to_pydatetime()
        return rv
1124838
def _format_date(self, obj) -> str:
        
        if obj is None:
            return ''
        if isinstance(obj, datetime):
            obj = obj.date()
        return date_format(obj, 'SHORT_DATE_FORMAT')
539573
def format( self ):
        
        if ( self._format is not None ):
            return self._format
        
        rtype = self.rulerType()
        if ( rtype == XChartRuler.Type.Number ):
            self._format = '%i'
        
        elif ( rtype == XChartRuler.Type.Date ):
            self._format = 'M.d.yy'
        
        elif ( rtype == XChartRuler.Type.Datetime ):
            self._format = 'M.d.yy @ h:mm ap'
        
        elif ( rtype == XChartRuler.Type.Time ):
            self._format = 'h:mm ap'
        
        return self._format
495781
def datetime(self):
        
        date_string = '%s %s' % (self._date, self._year)
        date_string = re.sub(r' \(\d+\)', '', date_string)
        return datetime.strptime(date_string, '%A, %b %d %Y')
1055759
def date(self, pattern='%Y-%m-%d', end_datetime=None):
        
        return self.date_time(end_datetime=end_datetime).strftime(pattern)
1165964
def str_to_date(self):
        

        if hasattr(self, 'date'):
            return date(*list(map(int, self.date.split('-'))))
        else:
            return None
578854
def serialize(self, dt):
        
        if dt is None:
            return str(dt)
        return dt.strftime(self.date_format)
268749
def date(date):
    
    date = date.value
    return (datetime.strptime(date[:-5], '%Y-%m-%dT%H:%M:%S')
            if len(date) == 24
            else datetime.strptime(date, '%Y%m%dT%H:%M:%S'))
812684
private String getFormattedDate(Date date) {
		String formattedDate = "";
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		try {
			formattedDate = ValueFactoryImpl.getInstance().createValue(cal).getString();
		} catch (Exception e) {
			// should never happen
			e.printStackTrace();
		}
		return formattedDate;
	}
219859
def _format_strings(self):
        

        values = self.values.astype(object)
        is_dates_only = _is_dates_only(values)
        formatter = (self.formatter or
                     _get_format_datetime64(is_dates_only,
                                            date_format=self.date_format))
        fmt_values = [formatter(x) for x in values]

        return fmt_values
186601
public static String formatDate(Date date) {
		if (null == date) {
			return null;
		}
		return DatePattern.NORM_DATE_FORMAT.format(date);
	}
700394
def str_to_date(date: str) -> datetime.datetime:
    
    date = date.split('.')
    date.reverse()
    y, m, d = date
    return datetime.datetime(int(y), int(m), int(d))