Next: Date Component Formats, Previous: Binary and Hexadecimal Numeric Formats, Up: Input and Output Formats
In pspp, a time is an interval. The time formats translate between human-friendly descriptions of time intervals and pspp's internal representation of time intervals, which is simply the number of seconds in the interval. pspp has two time formats:
Time Format | Template | Example
|
---|---|---|
TIME | hh:MM:SS.ss | 04:31:17.01
|
DTIME | DD HH:MM:SS.ss | 00 04:31:17.01
|
A date is a moment in the past or the future. Internally, pspp represents a date as the number of seconds since the epoch, midnight, Oct. 14, 1582. The date formats translate between human-readable dates and pspp's numeric representation of dates and times. pspp has several date formats:
Date Format | Template | Example
|
---|---|---|
DATE | dd-mmm-yyyy | 01-OCT-1978
|
ADATE | mm/dd/yyyy | 10/01/1978
|
EDATE | dd.mm.yyyy | 01.10.1978
|
JDATE | yyyyjjj | 1978274
|
SDATE | yyyy/mm/dd | 1978/10/01
|
QYR | q Q yyyy | 3 Q 1978
|
MOYR | mmm yyyy | OCT 1978
|
WKYR | ww WK yyyy | 40 WK 1978
|
DATETIME | dd-mmm-yyyy HH:MM:SS.ss | 01-OCT-1978 04:31:17.01
|
The templates in the preceding tables describe how the time and date formats are input and output:
dd
mm
mmm
mm
is output as two digits, mmm
as the
first three letters of an English month name (January, February,
...). In input, both of these formats, plus Roman numerals, are
accepted.
yyyy
jjj
q
ww
DD
hh
HH
MM
SS.ss
For output, the date and time formats use the delimiters indicated in the table. For input, date components may be separated by spaces or by one of the characters ‘-’, ‘/’, ‘.’, or ‘,’, and time components may be separated by spaces, ‘:’, or ‘.’. On input, the ‘Q’ separating quarter from year and the ‘WK’ separating week from year may be uppercase or lowercase, and the spaces around them are optional.
On input, all time and date formats accept any amount of leading and trailing white space.
The maximum width for time and date formats is 40 columns. Minimum input and output width for each of the time and date formats is shown below:
Format | Min. Input Width | Min. Output Width | Option
|
---|---|---|---|
DATE | 8 | 9 | 4-digit year
|
ADATE | 8 | 8 | 4-digit year
|
EDATE | 8 | 8 | 4-digit year
|
JDATE | 5 | 5 | 4-digit year
|
SDATE | 8 | 8 | 4-digit year
|
QYR | 4 | 6 | 4-digit year
|
MOYR | 6 | 6 | 4-digit year
|
WKYR | 6 | 8 | 4-digit year
|
DATETIME | 17 | 17 | seconds
|
TIME | 5 | 5 | seconds
|
DTIME | 8 | 8 | seconds
|
For the time and date formats, the default output format is the same as the input format, except that pspp increases the field width, if necessary, to the minimum allowed for output.
Time or dates narrower than the field width are right-justified within the field.
When a time or date exceeds the field width, characters are trimmed from the end until it fits. This can occur in an unusual situation, e.g. with a year greater than 9999 (which adds an extra digit), or for a negative value on TIME or DTIME (which adds a leading minus sign).
The system-missing value is output as a period at the right end of the field.