The datetime Module for Date and Time in Python


Work with dates, times, and deltas in a straightforward way.

Source Code

from datetime import datetime, timedelta
now = datetime.now()
print("Now:", now)
one_week_later = now + timedelta(weeks=1)
print("One week later:", one_week_later)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments