Operations on Dates and Times

You can add or subtract two date values or two time values, which provides a Number result. In the case of dates, the number represents the difference between the two dates in days. In the case of time, the number represents the difference in seconds. You can also add and subtract numbers to or from a time or date, which results in another date or time. Again, in the case of days, the number represents days, and in the case of time, the number represents seconds.

The following table summarizes these operations:

Operation Result Type Result Represents

Time + number of seconds

Time

Resulting time

Date + number of days

Date

Resulting date

Date - date

Number

Difference in days

Time - time

Number

Difference in seconds

Date + time

DateTime

Date and time combined