Xbasic

- (Date Time Subtraction)

Syntax

Result as D = Operand1 as T - Seconds as N

Seconds as N = Operand1 as T - Operand2 as T

Arguments

Operand1

A date time value.

Operand2

A date time value.

Seconds

A number.

Description

Time subtraction produces a date time value or number by subtracting an integral or fractional number of Seconds from Operand1.

Examples:

The following example shows how to modify a date time variable (type T) by subtracting seconds.

t1 = now()
? t1
= 10/19/2005 11:07:07 53 am
t2 = ctodt("10/20/05 12:07:07 53 am")
? t2
= 10/20/2005 12:07:07 53 am
? t2 - t1
= 46799.992
? (t2 - t1)/60
= 780
? (t2 - t1)/3600
= 13
t1 = t1 - 3600
? t1
= 10/19/2005 10:07:07 53 am

See Also