Date Functions
These functions convert date data between standard calendar format and an integer or day of week value. Data is passed as arguments to these functions.
This function calculates the number of days from 31 December 1899 to the specified date.
You can use this function to calculate the number of days between two dates by subtracting the later date value from the earlier date value.
Syntax: date_value("date","date_format")
NOTE: If date is an empty string, this function returns 0. If date contains an invalid date, this function returns -3650000.
Examples:
date_value("2016-06-01" ,"yyyy-mm-dd") returns 42522
date_value("20160201" ,"yyyymmdd")- date_value("20160101" ,"yyyymmdd") returns 31
This function calculates the day of the week on which the specified date falls.
Syntax: date_name(date,"language")
Where the date parameter is in the date_value format (number of days from 31 December 1899 to the specified date) and the language parameter is a two-letter locale code representing the language as codified by the ISO 639 series of international standards for language codes.
The following language codes are supported:
da — Danish
de — German
en — English
es — Spanish
fr — French
it — Italian
nl — Dutch
pt — Portuguese
sv — Swedish
NOTE: If a language is not specified, this function returns the English name.
Examples:
day_name(today ()) returns the current server system day "Monday"
day_name(45522, "fr") returns "Mercredi"
day_name(Dimension [Date], "es") returns "Domingo"
day_name(Info[Invoice Date]) returns "Friday"
This function is the inverse of date_value. It converts date data from an integer that is the number of days from 31 December 1899 to the specified format.
Syntax: format_date(date_data, "output_format")
Example:
format_date(50129, "mm-dd-yyyy") returns 03-30-2037
format_date(today(),"YYYY/MM/DD") returns the current server system date 2017/03/21
This function returns the system date from the DiveLine server as an unformatted integer.
Syntax: today()
Example: today() returns 42562