Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Time
Date
8. What day is today?
Datetime
Summary

Instruction

Good job! Another thing we can do is create a date object with today's date. Take a look:

mad_fra_scheduled = datetime.date(2018, 12, 7)
today = datetime.date.today()
timedelta = today - mad_fra_scheduled
print('My flight from Madrid to Frankfurt was', timedelta, 'ago')

As you can see, we used datetime.date.today() to get today's date.

Exercise

How long has Daniel Higgins worked at the company so far? Create the today variable, which will store today's date. Count the timedelta and print the following:

Daniel Higgins has been with us for {timedelta}

Stuck? Here's a hint!

Use the following piece of code to get today's date:

today = datetime.date.today()

Then use the following piece to find the difference:

today - higgins_start_day