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 Today and Tomorrow


What is the point of the Timestamp() function, I'm having a hard time understanding its importance.

2 Answers

timestamp() is special because it gives you the number of seconds from a particular point in time to another point in time. The originating point of time is January 1, 1970. If you call now.time() you are getting the number of seconds between January 1, 1970, and now. Now assume that you have a program where different users are doing some action like make an entry or take a photo. You could have the program store the timestamp of each action. Then later if you want to compare what action was earliest, you could do this by simple numeric comparison. If you stored string values for month, date, date, time you would have difficulty doing comparison without a lot of conversions. I think of the POSIX timestamp() as w universal way to measure how recent (or old) something is with less code because the starting point is fixed and the same across all users of this function.

Yes. He does not explaining it. just keeping talking like everyone already know this. I had to google it.

take this as a feedback. you should tell all the teacher to explain things in detail. we are not here to watch how to code. we are here to learn.