VALID_DATE

Script Function: Checks if the date is valid

Syntax

VALID_DATE ([Date Format:]Date)

Syntax

Description/Format

Date

Date in YYMMDD or YYYYMMDD format

Format: script literal or script variable

(Optional) You can specify a different date format: enter the desired date format, a separator (: or ;) and the date.


Return codes

"Y" - The date is valid
"N" - The date is invalid

Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date.

Tip: Use the :ON_ERROR script statement to define action to take if the date is invalid. For more information, see Script Elements for Error Handling.

Example

The example checks if the year 2001 is a leap year. The result (N) is output in the activation report.

:SET &RET#=VALID_DATE("DD.MM.YYYY:29.02.2001")
:
PRINT &RET#

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts