Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKade Carlson
5,928 PointsNot sure what this question is trying to ask
The wording of this task is kind of confusing to me
import datetime
def minutes(datetime1, datetime2):
now = datetime2 - datetime1
return round(now.timedelta.total_seconds())
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsYou are actually very close. When subtracting to date the time objects the result is a timedelta object. So, now
is a time delta object that has the method total_sec()
. Divide this value by 60 and you will get the seconds you seek.
- change
now.timedelta.total_sec
tonow.total_sec
- divide this by 60 before you round
Post back if you have anymore questions. Good luck!!!
Kade Carlson
5,928 PointsKade Carlson
5,928 PointsIt worked thank you so much!