Cicode Programming Reference > Cicode Function Categories > Time and Date Functions Introduction > DateSub

DateSub

Subtracts time (in seconds) from a time/date value. The return value is in time/date variable format. Use this function for time and date calculations.

Syntax

DateSub(Time, SubTime)

Time:

The time/date from which the SubTime will be subtracted.

SubTime:

The time to subtract, in seconds.

Return Value

The time difference (in seconds) as an integer.

Related Functions

Date, DateAdd

Example

Variable=DateSub(StrToDate("05/11/91"),StrToDate("03/11/91"));
! Sets Variable to number of seconds between 2 date/times.
Str=TimeToStr(Variable,5);
! Sets Str to "48:00:00".

See Also

Time/Date Functions