LogiView

Function 'date_sub'

     
Use this function to subtract two dates.

Please note that there is a valid range for dates defined. The lower boundary is 1970-01-01 while the upper boundary depends on the type of computer architecture being used.

Only calculations that do not exceed those boundaries can be performed with this function.

 

Syntax:

  {DAT_VAR|STR_VAR}= date_sub({DAT_EXPR},{DAT_EXPR})
 

I/O parameters:

{DAT_EXPR} Base date
{DAT_EXPR} Date to be subtracted.
-  
 

Return value:

 
{DAT_VAR|STR_VAR} Resulting date
 

Example:

  Declaration of Variables
 
10 DOCU_STRING_1 = date_sub(date(),"0000-00-14 00:00:00")
20 put(DOCU_STRING_1)
 

Result: (date() provides the current date: 1999-08-10 11:31:39)

A boundary check is performed for all calculated dates. If an invalid date is found days are being subtracted until the date does not exceed the range.

Functions and commands: Date and Time