Python Time module

Source: Internet
Author: User

Time module in 1.python

time modules are mainly processed on a temporal schedule. I use a graph to represent time, which involves three concepts: timestamp, TIME structure,

Time string

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8C/69/wKiom1hrZaTyjKC3AAAsBL4Y4Gs885.png-wh_500x0-wm_3 -wmp_4-s_385892242.png "title=" capture. PNG "alt=" Wkiom1hrzatyjkc3aaasbl4y4gs885.png-wh_50 "/>

The time module mainly deals with these three relationships.

Description of functions in the 2.time module.

2.1 time.localtime () This function is used to convert the timestamp to time_struct time, not to pass the parameter, the default is the current timestamp.

2.2 Time.time () Gets the current timestamp,

2.3 Mktime Gets the timestamp, the input parameter is the time structure body time_struct


2.4 strftime (format,struct time) converts the temporal structure to a time string.

2.5 strptime (str, format) converts a string into a time struct.

2.6 Asctime () has a timestamp converted into a time string

2.7 clock () Gets the timestamp when the CPU is occupied.

Python has a lot of time modules and Time,datetime,calender.

Python Time module

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.