liveBook · Manning

Date arithmetic

The calculation of dates and intervals by adding, subtracting, or otherwise manipulating time values.

How 2 Manning books explain it

Software Design for Python Programmers

Date arithmetic is the calculation of dates by adding or subtracting time intervals and determining differences between dates.

How it is used
Supports Date objects that add intervals and calculate signed differences while hiding their internal representation.
How deep it goes
Descends from calendar rules to loop-based stepping and Julian-number internals, while exposing conversion costs and implementation tradeoffs.
Examples
Uses September 2, 2025, April 3, 2027, loop-based stepping, and Julian-number addition and subtraction.
What you can do after
Build it from scratch in a Python Date class using calendar-aware stepping or Julian-number arithmetic.

Read how Software Design for Python Programmers explains date arithmetic →

Object-Oriented Software Design in C++

Date arithmetic is the computation of dates and intervals by adding, subtracting, or otherwise manipulating calendar-day values.

How it is used
Uses date arithmetic to implement Date operations for advancing dates and measuring intervals.
How deep it goes
Compares loop-based and Julian-number implementations, including performance costs and representation conversions.
Examples
Demonstrates September 2, 2025 to April 3, 2027, yielding 578 days and the matching destination date.
What you can do after
Evaluate loop-based and Julian-number implementations and recognize their distinct performance costs.

Read how Object-Oriented Software Design in C++ explains date arithmetic →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.