Get the Current Date in Python

In this article, we are going to learn how we can get the current date in Python. We will make use of the datetime module of Python to get the current date. Once we have the current date then we will print it.

Environment & Requirements :
Python interpreter
datetime library

Program to get Current Date

from datetime import date
date_today = date.today()
print("Today's Date is : ", date_today)

Output –
Current date: 2022-12-31

Program code explanation

1.First we imported the date class from the datetime module.
2.we used the date.today() method to get the current local date.