Datetimes. The bane of our existence as coders (or at least for me anyway!).
This set of lessons will walk you through the basics of datetime, starting with datetime and date then moving onto timedelta.
A super basic day to get you started. Watch Learning datetime and date and Calculating time with datetime timedelta.
After watching the videos, use your Python shell to play around with some timestamp calculations as per the content in the videos.
Head on over to CodeChalleng.es and sign up if you haven't already.
Use the following URL to unlock Bite 7 for free: https://codechalleng.es/bites/promo/datetimes
Work on Bite 7 - Parsing dates from logs for your second day of learning datetime.
Edit: We decided to simplify Bite 7 slightly after some feedback we received from students. We've now removed the requirement to read in the file which should keep the Bite focused on the theme.
Additionally, we've added another TWO free Bites that should be more appropriate for beginners. Unlock them here: https://codechalleng.es/bites/promo/datetimes_starter and https://codechalleng.es/bites/promo/more-datetimes.
You've got the basics down so now create something for yourself!
A fun project would be to create yourself a Pomodoro Timer that incorporates datetime rather than just the time module. Have it display timestamps.
This could also be applied to a stopwatch app. Use time of course but also throw in the timestamps and even some basic calculations on the difference between the start and end timestamps.
We encourage you to pull request your work via PyBites Code Challenge #52. Have fun!
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag #100DaysOfCode.
Here are some examples to inspire you. Consider including @talkpython and @pybites in your tweets.
See a mistake in these instructions? Please submit a new issue or fix it and submit a PR.