标准类库-日期类型之datetime模块
by:授客 QQ:1033553122
可用类型 3
实践出真知 4
timedelta对象 4
class datetime.timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0) 4
类属性 5
实例属性(read-only): 5
支持的操作 6
实例方法 6
1、date对象 7
class datetime.date(year, month, day) 7
所有类方法(其它构造器) 7
classmethod date.today() 7
classmethod date.fromtimestamp(timestamp) 7
类属性 7
date.min 7
date.max 7
date.resolution 8
实例属性(read-only) 8
date.year 8
date.month 8
date.day 8
支持操作 8
实例方法 9
date.replace(year, month, day) 9
date.timetuple() 9
date.toordinal() 9
date.weekday() 10
date.isoweekday() 10
date.isocalendar() 10
date.isoformat() 10
date.ctime() 10
date.strftime(format) 11
date.__format__(format) 11
2、datetime对象 11
class datetime.datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None) 11
所有类方法(其它构造器) 11
classmethod datetime.today() 11
classmethod datetime.now(tz=None) 11
classmethod datetime.utcnow() 12
classmethod datetime.fromtimestamp(timestamp, tz=None) 12
classmethod datetime.utcfromtimestamp(timestamp) 12
classmethod datetime.fromordinal(ordinal) 12
classmethod datetime.combine(date, time) 12
classmethod datetime.strptime(date_string, format) 12
类属性 13
datetime.min 13
datetime.max 13
datetime.resolution 13
实例属性(read-only): 13
datetime.year 13
datetime.month 13
datetime.day 13
datetime.hour 13
datetime.minute 14
datetime.second 14
datetime.microsecond 14
datetime.tzinfo 14
支持的操作 14
实例方法 15
datetime.date() 15
datetime.time() 15
datetime.timetz() 15
datetime.replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]]) 15
datetime.timetuple() 15
datetime.utctimetuple() 15
datetime.toordinal() 16
datetime.timestamp() 16
datetime.weekday() 16
datetime.isoweekday() 16
datetime.isocalendar() 16
datetime.isoformat(sep='T') 16
datetime.__str__() 17
datetime.ctime() 17
datetime.strftime(format) 17
datetime.__format__(format) 17
3、time对象 17
class datetime.time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None) 17
类属性 17
time.min 18
time.max 18
time.resolution 18
实例属性(只读) 18
time.hour 18
time.minute 18
time.second 18
time.microsecond 18
time.tzinfo 18
实例方法 18
time.replace([hour[, minute[, second[, microsecond[, tzinfo]]]]]) 18
time.isoformat() 19
time.__str__() 19
time.strftime(format) 19
time.__format__(format) 19
time.utcoffset() 19
4、format格式 19
篇幅问题,采用网盘链接分享:
[优]标准类库-日期类型之datetime模块.pdf