The datetime Module for Date and Time in Python


Work with dates and times.

Source Code

from datetime import datetime, timedelta

# Current date and time
now = datetime.now()
print(now)

# Add days to the current date
future_date = now + timedelta(days=10)
print(future_date)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments