<<

Contents

Search

>>

 

TIME_DIFF

 

 

Function

 

 

Syntax:

TIME_DIFF(<Date-1>,<Time-1>,<Date-2>,<Time-2>)

 

<Date-1>

= <NUM-EXPRESSION>

<Time-1>

= <STRING- EXPRESSION>

<Date-2>

= <NUM- EXPRESSION>

<Time-2>

= <STRING- EXPRESSION>

 

Meaning:

TIME_DIFF returns the difference between <Date-1> / <Time-1> and <Date-2> / <Time-2> in seconds.

 

If <Date-1> / <Time-1> is earlier than <Date-2> / <Time-2> the result is negative otherwise positive.

 

If <Date-1> = 0 or invalid or <Date-2> = 0 or invalid, the difference between <Time-1> and <Time-2> is returned.

 

Parameter:

Date-1

Date in numeric format

Time-1

Time string in format HH:MM:SS

Date-2

Date in numeric format

Time-2

Time string in format HH:MM:SS

 

Sample:

DIFF1% = TIME_DIFF(0,"8",0,"10")               /* DIFF1% = -7200

DIFF2% = TIME_DIFF(0,"8:20:35",0,"12:16:20")   /* DIFF2% = -14145

DIFF3% = TIME_DIFF(0,"12:16:20",0,"8:20:35")   /* DIFF3% = 14145

DIFF4% = TIME_DIFF(20130101,"8",20130101,"12") /* DIFF4% = -1440

DIFF5% = TIME_DIFF(20130101,"12",20130101,"8") /* DIFF5% = 1440

DIFF6% = TIME_DIFF(20130101,"0",20131231,"24") /* DIFF6% = -31536000

TIME6$ = STRTIME$(-DIFF6%)                     /* TIME6$ = "8760:00:00"

 

See also:

TIME_ADD$

STRTIME$

TIME_TO_SECONDS