该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


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.
Informat( "19May2011 11:37:52 AM", "ddMonyyyy h:m:s" );
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.
Format( 3388649872, "ddMonyyyy h:m:s" );
Format( Today(), "ddMonyyyy h:m:s" );
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",
New Column( "Date",
"Continuous",
Format( "m/d/y" ),
Input Format( "d/m/y h:m" ),
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.
图 6.3 Example of Date-Time Display and Input Values
注意: 
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.