Show TOC

Background documentationFunctions: Date Locate this document in the navigation structure

 

Functions with “*” are extended functions for the Electronic File Manager: Format Definition add-on.

Parameters suffixed with a question mark “?” have a default value and can be omitted.

*now(string format?)

Description: Returns the current date and time in a specific format. The default format is ISO8601 “yyyy-MM-ddTHH-mm-ss”.

Sample:

now(‘yyyyMMddhhmmss’) returns “20090929094252”

now() returns “2009-09-29T09-42-52”

*today(string format?)

Description: Returns the current date in a specific format. The default format is ISO8601 “yyyy-MM-dd”.

Sample:

today(‘yyyyMMdd’) returns “20090929”

today() returns “2009-09-29”

*format-date(string date, string dateFormat, string targetFormat)

Description: Converts a string of date to a string with target format.

Sample:

format-date(today(), 'yyyy-MM-dd', 'MM/dd/yyyy') returns '09/04/2009'

*date-diff(string date1, string date2, string format1?, string format2?)

Description: Returns the number of different days between two dates. The default value of format1 and format2 is ISO8601 “yyyy-MM-dd”.

Sample:

date-diff(“20091026”, “20090930”, “yyyyMMdd”, “yyyyMMdd”) returns 26

date-diff(“2009-09-30”, “2009-10-26”) returns -26

*date-add(string date, number day, string format)

Description: Returns a specified date with the specified number interval (signed integer) added to a specified date part of that date.

Sample:

date-add(today(‘yyyyMMdd’), 1, ‘yyyyMMdd’) returns '20090905'