Master Python’s datetime type
Python’s
datetime
library, part of its standard library, provides datatypes and methods for working with dates and times. Dates and times are slippery, inconsistent things, however, and libraries for working with them can only smooth things over so much.In this article, we’ll explore how to use Python’s
datetime
library, its datatypes, and its methods. You’ll learn how to make the most of these features while steering clear of their traps and complexities in Python.datetime objects and namespacing
The name
datetime
refers to both thedatetime
library and to one of the Python datatypes. The library is namespaced as justdatetime
. But the datatype for date-time objects is namespaced asdatetime.datetime
.
Author: . [Source Link (*), InfoWorld]