Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Dates and Times in Python Dates and Times Timedelta Minute

timedelta.total_seconds() Once again quizzing over material not covered

Unfortunately This happens too often in Kenneth Loves "courses" and other treehouse courses The subject is not difficult but presented poorly. I would be happier with treehouse if there was more thorough explanations, maybe several examples and variations All of the practical uses are not apparent when presented in a rushed manner Not to mention it is antiquated

For instance total_seconds is not covered in the preceding information. Why can total_seconds not be used on a datetime but can be used on the addition or subtraction of two or more datetimes? The distinction between datetime vs timedelta could be explained better with maybe a reference to total_seconds.

2 Answers

Chris Freeman
Chris Freeman
Treehouse Moderator 67,736 Points

Hi wc93! This material can be difficult with so many terms similar sounding object names. The objects date, time, datetime, and timedelta each being unique object types and manipulating combinations of them is not straightforward.

Each type has its own attributes that may be unique. Math between two datetime objects yields a timedelta object. Math can also occur between a datetime object and a timedelta object to get a new datetime object.

To your specific question, a datetime is a point in time and a timedelta is a span of time, hence their attributes would differ.

It is impossible to teach about every object attribute and method available. One of the goals here is to help the student learn to consult the documentation as needed. I get that this isn’t a very satisfying answer, but know that almost every Python programmer has to consult the docs since there are so many details to keep straight.

Post back if you need more help. Good luck!!!

Thanks Chris. I was able to finish it using other sources. My questions were largely rhetorical as examples of things to teach. My beef is that the base material was covered poorly. Some of Kenneth Love's courses have been informative. Many Treehouse courses are improperly paced. They rush through dense information and then stroll through much easier information. For example the timezone section of this course was more relaxed. Also there is a big difference between the coding tests which are often absurdly vague and the multiple choice tests that are often absurdly easy. I did have to go elsewhere for the information and it makes me wonder if paying for a Treehouse membership is worth it. So much of the stuff I have been interested in is way out of date. I don't expect everything to be covered. It changes too quickly. But with the amount of people paying for subscriptions there should be more updates that are more up-to-date. I only see two new courses on the horizon. Maybe there is a whole side of Treehouse that is hidden in the TechDegree side but I don't know that I want to pay to find out that it too is outdated. There are many people who have been helpful such as yourself and other members of the community and I am thankful. I am not as thankful that the preview button covers some of the text in this input text area though. Cheers.

Chris Freeman
Chris Freeman
Treehouse Moderator 67,736 Points

All fair points. I wish I knew the Python future here, but I don’t have any insights on Treehouse roadmap for Python and I have zero inside information. I enjoy spreading understanding where I can. Good luck!