Template:Time interval/doc

This template calculates the date/time difference between two dates. Dates in the Gregorian calendar from 9999 BCE to 9999 CE are supported. The calendar is proleptic—it is assumed to apply at all times with no irregularities.

Syntax


There are two positional arguments: date1 and date2. The default for each is the current date and time.

The result displays text representing the time interval from date1 to date2 (date2 − date1).

Dates are UTC—local times and time zones are not supported.

Dates are checked for validity. For example, 29 February 2000 is accepted, but 29 February 1900 is not a valid date.

Each date can include an era or a time, and a variety of formats are accepted. Examples of valid dates are:
 * 1900-02-01
 * 1900-2-1
 * 1900-02-01 14:45
 * 1 FEB 1900
 * February 1, 1900
 * February 1 1900 14:45
 * 2:45 pm February 1 1900
 * 1 February 1900 2:45 p.m.
 * BC 1 Feb 120

Examples: