Python provides a variety of time and date processing methods, mainly in time and datetime modules. In this article i will show you some time and datetime module examples to tell you how to use them in python.
When writing Python code, we often encounter the problem of time format. The first thing is the conversion between timestamp and date time fromat string. The timestamp is the number of seconds from 00:00:00 on January 1, 1970 to the present day. In Python, timestamp can be obtained by the time() method in the time
In Python, there are three modules to process time, they are time, datetime, and calendar. And time is represented in three ways: a timestamp, a formatted time string, and a structured time. This article will focus on the time module, we will introduce other two modules in later articles.