getDateDMYFormat( )
Return a date or datetime in DD-Mon-YYYY format, including time elements if applicable. This function supports partial dates.
Syntax
getDateDMYFormat(vDate, [timeFormat])
Parameters
Parameter | Required/Optional | Description |
---|---|---|
vDate |
Required | Rule variable of date or date/time type to be
retrieved in DMY format.
Note: This is a JavaScript function. Quotes are not needed in the rule variable name. |
timeFormat |
Optional | Specifies the output format for the time elements
present. This can be one of the following values (case-sensitive),
all in a 24-hour format:
If |
Note:
Previously, this function used to take an optional boolean value as the second parameterisPartial
,
to specify whether the function is expecting a partial date or not. This function
still accepts true
and false
as the
second parameter, instead of the timeFormat
parameter, to continue
supporting existing rules.
Return value
Date in DD-Mon-YYYY, for example UNK-Jan-2025 or 01-Feb-2021 23:45:00.
Examples
Example 3-39 Return a partial date in DD-Mon-YYYY format
var mdyDate = getDateDMYFormat(vDate);
return mdyDate.toString();
// returns date as string "UNK-Jan-2025"
Parent topic: Date and time functions