Skip to content

7.7.8.5 Functions that Examine Dates ​

These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

date

A numeric value in PSPP date format.

time

A numeric value in PSPP time format.

time-or-date

A numeric value in PSPP time or date format.

Function: __XDATE.DATE ( time-or-date)

For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in.

Function: __XDATE.HOUR ( time-or-date)

For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time.

Function: __XDATE.JDAY ( date)

Results in the day of the year (as an integer between 1 and 366) corresponding to date.

Function: __XDATE.MDAY ( date)

Results in the day of the month (as an integer between 1 and 31) corresponding to date.

Function: __XDATE.MINUTE ( time-or-date)

Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date.

Function: __XDATE.MONTH ( date)

Results in the month of the year (as an integer between 1 and 12) corresponding to date.

Function: __XDATE.QUARTER ( date)

Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

Function: __XDATE.SECOND ( time-or-date)

Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date.

Function: __XDATE.TDAY ( date)

Results in the number of whole days from 14 Oct 1582 to date.

Function: __XDATE.TIME ( date)

Results in the time of day at the instant corresponding to date, as a time value. This is the number of seconds since midnight on the day corresponding to date.

Function: __XDATE.WEEK ( date)

Results in the week of the year (as an integer between 1 and 53) corresponding to date.

Function: __XDATE.WKDAY ( date)

Results in the day of week (as an integer between 1 and 7) corresponding to date, where 1 represents Sunday.

Function: __XDATE.YEAR ( date)

Returns the year (as an integer 1582 or greater) corresponding to date.

基于 GNU PSPP 2.0.1 手册与入门教程整理