发布日期: 11/15/2021

Date-Time Values

Date-time values are stored and calculated as the number of seconds since midnight, January 1, 1904. For example:

Today(); // returns 3388649872 on May 19, 2011 at 12:00:00 AM

As with Today(), the Date DMY() and Date MDY() functions also return month, day, and year arguments as seconds. For example, if it were 12:00:00 a.m. on May 19, 2011, all of the following statements would return the same value:

Date DMY( 19, 5, 2011 );
Date MDY( 5, 19, 2011 );
Today();

3388608000

The As Date() function takes the number of seconds and displays it as a date or duration.

Values that represent one year or more are returned as dates:

As Date( 3388608000 );

19May2011

Values that represent less than a year are returned as durations.

As Date( 50000 );

:0:13:53:20

You can use date-time values in two ways:

a literal value, for example 19May2011:10:10

a string, for example "Thursday, May 19, 2011"

You can perform arithmetic with date-time literals, which use the number of seconds as the base number.

As Date( 19May2011 + 1 );

19May2011:00:00:01

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).