Skip to main content

Define a Time Interval

A time interval represents the duration between two dates or times. In Decipad, you can calculate time intervals and convert them to different units.

Calculating Time Intervals

To calculate a time interval between two dates, you can subtract one date from another:

This example calculates the number of days between the two dates.

Converting Time Intervals

Once you have a time interval, you can convert it to different units using the as keyword.

For example, you can convert the time interval to hours:

Or to minutes:

You can also convert to seconds:

And even milliseconds: