This article describes the Python simple format of the time of the method, shared for everyone to refer to, specifically as follows:
Walker often uses the current time and relative time to count the efficiency of the program's execution, simply by remembering it for easy copy.
>>> Import Time
>>> starttime = Time.time ()
>>> '%.2fs '% (Time.time ()-StartTime) #相 On time
' 24.51s '
>>> ' {:. 2f}s '. Format (Time.time ()-starttime) #相对时间
' 37.55s '
>>> Time.strftime ('%y-%m-%d%h:%m:%s ', Time.localtime (time.time)) #格式化当前时间
' 2016-01-05 10:34:06 '
PS: This site also provides a UNIX timestamp conversion tool (summary of the various common language timestamp operation), very practical, to provide you with reference to:
Unix timestamp (timestamp) conversion tool:
Http://tools.jb51.net/code/unixtime
More information about Python-related content can be viewed in this site: "Python date and time operation tips Summary", "Python URL operation tips Summary", "Python picture operation Tips", "python data structure and Algorithms tutorial", "python A summary of socket programming tips, a summary of Python function usage tips, a summary of Python string manipulation tips, Python introductory and Advanced classic tutorials, and Python file and directory how-to tips
I hope this article will help you with Python programming.