def strftime(self, format):
"""Format the date/time using the *current timezone representation*."""
x = _calcDependentSecond2(self._year, self._month, self._day,
self._hour, self._minute, self._second)
ltz = self._calcTimezoneName(x, 0)
tzdiff = _tzoffset(ltz, self._t) - _tzoffset(self._tz, self._t)
zself = self + tzdiff / 86400.0
microseconds = int((zself._second - zself._nearsec) * 1000000)
unicode_format = False
if isinstance(format, explicit_unicode_type):
format = format.encode('utf-8')
unicode_format = True
ds = datetime(zself._year, zself._month, zself._day, zself._hour,
zself._minute, int(zself._nearsec),
microseconds).strftime(format)
if unicode_format:
return ds.decode('utf-8')
return ds
# General formats from previous DateTime
评论列表
文章目录