This article mainly introduces the datetime module in the python time module. The interface of the datetime module is more intuitive and easier to call, if you want to know about the datetime module, you can refer to Python to provide multiple built-
It seems that the Date object of js is not very convenient to use. According to the DateTime of C #,
Method annotation:
Add the specified number of days to the value of this instance.
Add the specified number of hours to
Method annotation:
Add the specified number of days to the value of this instance.
Add the specified number of hours to the value of this instance.
Add the specified number of minutes to the value of this
Method Annotation:
Adds the specified number of days to the value of this instance.
Adds the specified number of hours to the value of this instance.
Adds the specified number of minutes to the value of this
DateTime is the standard library for Python to process dates and times.Get the current date and timeLet's look at how to get the current date and time: from datetime import datetime>>> now = DateTime.Now () # Gets the current datetime>>> Print /c3>--
Python provides several built-in modules for manipulating date times, like Calendar,time,datetime. Time module I have described in the previous article, it provides the interface and C standard library time.h basically consistent. The interface of
ObjectiveInterpretation of related termsThe manifestation of timeTime ModuleDateTime moduleTime Format CodeSummarizeObjectiveIn the development work, we often need to use the date and time, such as:Content output as log informationCalculate the
One time PackageSleep ([float time]) delays a number of seconds in floating-point numbersThe time package is based on the C language library function (functions).Python's interpreter is generally written in C, and some Python functions also call the
In the time to do the problem with a few topics need to be timestamp, Datetime, UTC a few times between the conversion, just know that Python provides a very convenient and powerful time processing module, Master Good to use it will be very
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.