Skip to content

CDN

Returns Current Date in SQL Numeric Format

This system variable returns the current date and time in SQL numeric format, which is days and decimal days since 01-JAN-0001, with enough significance to detect fractions of a second.

CDN

This system variable is a numeric value and may be used in numeric expressions.

LET TODAYS_DATE_NUMBER = CDN

At noon on 07-JUN-1989, TODAYS_DATE_NUMBER contains the value 726262.5 (9:00AM that same day is 726262.375).

LET DUE_DATE$ = NTD(CDN+15)

shows some of the usefulness of CDN in business applications. Assuming the same date for today as above, this LET directive causes DUE_DATE$ to contain the value:

“22-JUN-1989 12:00:00”

The SQL date format is corrected for leap years, including century multiples.

DTN and NTD functions
CDS system variable

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF