Contents - Index


Date and DateTime Formats

 

Date format is an output display option for numerical values.  There are ten options for date format as displayed in the following list.

 

 

Default sets the output to the short date string format that has been set in the Windows Operating system.  You can change this format using the Control Panel for Region and Language.  The other formats are identified by a format string involving d (for day), m (for month) and yy (for a 2-digit year) or yyyy (for a 4-digit year) .  Note that lower case m indicates that the month is represented as a number between 1 and 12 whereas uppercase M indicates that the month is spelled out.

 

The DateTime format differs from the Date format in that it will display the date followed by the time of day in hh:min:sec

 

The value for a date variable may be entered into the Equations window as a string representing the date in any acceptable format using the Date function. For example, the following equation will set variable myDate to Mar 15, 2022.

 

myDate=date('15 Mar  2022')

 

Date and DateTime values are internally stored as the number of days that have passed since December 30, 1899.  The date appears as a number to the left of the decimal point.  The time of day is encoded in the number to the right of the decimal point.  This numerical representation is consistent with that used in other programs, such as EXCEL.  If myDate is set to display as a numerical value, its value will be numerical value.  The display format can be changed to a Date or DateTime format in the Solutions window, Variable Information dialog or by clicking on the header cell in the Parametric, Lookup, and Arrays tables and setting the format style to Date or DateTime, as shown below. Values in date or datetime formats can then be directly entered into Lookup and Parametric table cells.  

    

 

   

 

 

See also: Date function