Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

AddDuration Function

Overview

The AddDuration function adds or subtracts an ISO duration string to an ISO-8601 formatted date/time and returns an ISO-8601 date/time..

Syntax/Parameters

Syntax

string = AddDuration ( string value, string bias );

Parameters

value

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

bias

An string containing a formatted ISO duration such as P1D or P1Y1M.

Return Value

Returns a string as an adjusted ISO-8601 date or an empty string on failure. Use the GetLastError function to retrieve a formatted error code. The most common error is a format or syntax error in the source value parameter.

Remarks

The AddDuration applies the date/time adjustment in two modes: (1) values of days or lesser fraction are added via seconds math while (2) months and years are added as whole units. As such adding P90D is not the same as adding P1M. The value 90 days is not exactly three months.

When adding months, if the day of the month is at the end of the month, the last day of the month will be adjusted accordingly. For example, P3M on 03-31 will result in 06-30, not 06-31.

Related Functions 

Platform Support

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

Legato IDE, Legato Basic