Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

Going to tomorrow

When you have a date, it's common to need to apply math to that date. For example maybe you want to move to tomorrow or to yesterday.

Datetimes support math operations, such as adding or subtracting to them, but when time is involved, it's not easy to get the exact number of seconds you need to add or subtract to move to the next or previous day.

For this reason, this recipe will show off an easy way to move to the next or previous day from any given date.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content