Python date - class level attribute

The list of class level attributes defined in the Python date class include date.min, date.max and date.resolution and an example program is given here

Date Updated 10 Feb 2017 1 min read

List of class level attributes defined in datetime.date

Attribute NameDescription
date.minIs the minimum date supported in Python.
date.maxIs the maximum date supported in Python
date.resolutionIs the minimum resolution between two dates of different values

Example

python
import datetime

# print supported minimum date

minDate = datetime.date.min

print("Supported minimum date in Python is {}".format(minDate))

# print supported maximum date

maxDate = datetime.date.max

print("Supported maximum date in Python is {}".format(maxDate))

# Minimum resolution between two dates in Python

minResolution = datetime.date.resolution

print("Minimum resolution between two dates in Python is {}".format(minResolution))

Output

Output
Supported minimum date in Python is 0001-01-01

Supported maximum date in Python is 9999-12-31

Minimum resolution between two dates in Python is 1 day, 0:00:00