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 trial

Python Dates and Times in Python (2014) Dates and Times Today and Tomorrow

Timestamp()

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.