In data tables, JMP can accept the input of date-time values in one format (the input format), store them internally as the number of seconds since the base date, and display them in a different date-time format. The Informat() and Format() functions give you this control.
•
|
Informat() takes a string date-time value, defines the date format used in that string, and returns the date in ddMonyyyy format.
|
•
|
Format() takes the number of seconds since the base date (or a date-time function that returns that number) and returns the date in the specified format.
|
Suppose that you are entering dates into a column using the d/m/y h:m format, but you want to see the dates in the m/d/y format. Input Format defines the input format, and Format defines the display format. For example,
New Table( "Widget Assembly",
Add Rows( 1 ),
Set Values( [3126917100] )
The Format and Input Format values are shown in the data table’s column properties (图 6.3). Note that when you click in the cell to edit it, the date-time value appears in the input format. When you edit the value, or add a new value, the format specified in the data table column Format list is used to display the value.
•
|
In a script that converts a column from character to numeric, specify Format() and Informat() to prevent missing values. See “Convert Character Dates to Numeric Dates” on page 807 in the “Common Tasks” chapter for details.
|
•
|
The date-separator character on your computer might differ from the forward slash (/) character shown in this book.
|
Date-Time Formats describes the formats used as arguments in date-time functions or as data table formats. You can also use the formats for the format argument to a Format message to a data column. See “Set or Get Formats” on page 383 in the “Data Tables” chapter.
For descriptions of specific date-time functions, see “Date and Time Functions” in the JSL Syntax Reference.