Contents - Index


Date

 

The Date function accepts a string constant or string variable representing a date or date/time and converts it into a number.  Dates are internally stored as the number of days that have passed since December 30, 1899.  The time of date is encoded as a number to the right of the decimal point.  This numerical representation is consistent with that used in other programs, such as EXCEL.  The string representation of the date is accepted in multiple forms, as shown in the following example.

 

This program shows the different ways that a date can be entered using the Date function.

 

 

 

After running this program, the Arrays table will appear showing the numerical equivalent of the date.  Note that all of the entries are the same indicating all of the date strings were all accepted to represent March 15, 2022.  The entries are displayed as a number because the display format for the Date array is initially set to Auto, which is a numerical format.

 

 

The numerical values in the table can be displayed as a date in a chosen date format.  To change the display format in this example, right click in the header cell of the Date[i] column and select Properties from the popup menu.  The Format Arrays Table dialog will appear.  Use the arrow in the Style box to change the format style to Date or DateTime.  Then select a Date or DateTime format from the control to the right of the Style box.  

 

 

 

See also:  Date Format

                DATE$

                DATETIME$