Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

SubtractDates Function

Overview

The SubtractDates function subtracts two date (and time) values and returns the difference in whole days.

Syntax/Parameters

Syntax

int = SubtractDates ( string a, string b );

Parameters

a   b

string values in ISO-8601 format. The format need not contain the time.

Return Value

Returns an int as the number of whole days or a formatted error code on failure. The lower nybble of the error code specifies if a syntax error is in a or b.

Remarks

The SubtractDates function takes the date a, subtracts the date b from it, and returns the number of days different. If time values are provided, they are counted as part of the date. Therefore, subtracting 2015-02-02T12:30 from 2015-02-03T11:30 will result in 0 days. Subtracting 2015-02-02T12:30 from 2015-02-03T11:30 will result in 1 day.

The SubtractDates function will count the leap years and days of months to make its adjustments. The source dates must be later than January 1, 1601.

Related Functions 

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic