datetime.date.today () local date object (str function available with its literal representation (2014-03-24)) datetime.date.isoformat (obj) current [year - month - day] string representation (2014 -03-24) datetime.date.fromtimestamp () returns a date object, the argument is a timestamp, returns [year - month - day] datetime.date.weekday (obj) returns the number of weeks a target date of Monday is 0 datetime .date.isoweekday (obj) returns a date object a few weeks, Monday is 1 datetime.date.isocalendar (obj) returns a tuple to date objects with a date of datetime objects: datetime.datetime.today () returns datetime objects containing a local time (including the number of microseconds) 23 is 2014-03-24: 31 is: 50.419000 datetime.datetime.now ([TZ]) returns the specified time zone 23 is datetime objects 2014-03-24: 31 is: 50.419000 datetime .datetime.utcnow () returns a 0:00 region datetime objects datetime.fromtimestamp (timestamp [, tz]) returns a datetime objects by time stamp, time zone can be specified, can be used to convert a date strftime showing datetime.utcfromtimestamp (timestamp) time UTC-datetime stamp of a return datetime.datetime.strptime ( '2014-03-16 12:21:21', " % Y-% m-% d% H:% M:% S") the string into datetime objects datetime.datetime.strftime (datetime.datetime.now (), '% Y % m% d% H% m% S') to convert datetime objects str representation datetime.date.today (). timetuple () to a timestamp datetime tuple objects can be used to convert a timestamp datetime.datetime.now (). timetuple () time.mktime (timetupleobj) tuple objects into the datetime stamp the time.time () current timestamp time.localtime time.gmtime --- ------------------ author: changaspl source: CSDN original: https: //blog.csdn.net/qq_40674583/article/details/81940974 copyright: This article is blogger original article, reproduced, please attach Bowen link!