Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Mastering Python's Built-in time Module (Summary)

Congratulations! You’ve learned the fundamental concepts surrounding date and time. It’s time for you to apply your newfound knowledge in your real world applications.

In this course, you learned how to:

  • Use a floating point number, representing seconds elapsed since the epoch, to deal with time
  • Manage time using tuples and struct_time objects
  • Convert between seconds, tuples, and timestamp strings
  • Suspend the execution of a Python thread
  • Measure performance using perf_counter()

If you want to continue learning more about using dates and times in Python, take a look at the following modules:

  • datetime: A more robust date and time module in Python’s standard library
  • timeit: A module for measuring the performance of code snippets
  • astropy: Higher precision datetimes used in astronomy

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 Over the course of this series, you’ve learned a whole lot about the Python time module. You’ve learned about epochs, time zones, and daylight savings time: the building blocks of how Python represents time.

00:11 You’ve learned several different objects that you can use in your code to represent time, like floats, tuples, the struct_time, and even strings.

00:19 You’ve learned how those objects form a kind of bi-directional continuum with ease of operability for machines on one side, and then ease of intelligibility for humans on the other.

00:30 Finally, you’ve learned how to convert between different time representations, and you’ve learned a couple of useful functions that the time module offers you, like the sleep function that you can use to suspend thread execution, and the perf_counter function, which gives you a really precise measuring tool that you can use to either measure your code performance or, really, any other time where you need a precise time span.

00:52 If you’re interested in Python time and dates more broadly, then I would say that you should go next to the Python datetime module, and there are Real Python tutorials on that module as well.

01:03 It’s a really fantastic module, especially for date manipulation, so check that out. In the meantime, thank you very much for watching this Real Python video tutorial series on the time module.

01:15 I had a really good time teaching it, and I hope you had a good time learning from it as well.

Avatar image for Ghani

Ghani on Oct. 28, 2020

Excellent course; thank you very much!

Become a Member to join the conversation.