DOC

How calculators work

How a Financial Calculator Counts Days Between Dates

Date arithmetic is not simply subtracting two strings. A financial calculator must choose a calendar convention, handle leap years, and count the interval.

A loan begins on September 4 and the first payment arrives on November 1. The calculator is asked for the number of days in between. It cannot subtract 11 from 9. Months do not share a length, February is troublesome, and financial conventions may deliberately replace the ordinary calendar with twelve equal 30-day blocks.

The result depends on the calendar story the calculator is told to use.

date 1calendar rulesintervaldate 2

Dates become positions on a calendar

A date worksheet turns each entered date into a point in a calendar system. The calculator can then count days forward or backward, or solve for a missing date when the interval is known.

TI’s BA II Plus guide exposes Date 1, Date 2, and DBD, the number of days between dates. It also lets the user select an actual/actual or 30/360 day-count method.

Two calendar pages connected by a measured ribbon of days and a financial calculator
The worksheet converts calendar pages into an interval that can be used in a financial calculation.
DT1first date
DT2second date
DBDdays between dates

February is a branch in the algorithm

Actual calendar counting must know whether February has 28 or 29 days. Leap years add a day that shifts every later interval in that year. The machine is not learning astronomy; it is applying a rule set to the date fields.

A calendar timeline crossing February with an extra leap-year day highlighted
One extra calendar day can change the interval used for an interest calculation.
Februaryleap-year rule28 or 29 dayscontinue countinglater date

A convention can replace the calendar

Under a 30/360 method, every month is treated as 30 days and the year as 360 days. This is not a claim that the calendar has changed. It is a financial convention chosen to make certain calculations comparable and predictable.

The same loan timeline measured by an actual calendar and by equal 30-day blocks
Two day-count methods can be internally consistent while producing different intervals.
Date arithmetic is a rules engine wearing a calendar-shaped interface.

Sources and further reading