format Function (GPL)

Syntax

format("date format")

<format>. The date format of the data.

Description

Indicates the input format for a date variable in the source. This function does not change the format for the date; it only specifies the format that GPL should expect. Use one or more of the following abbreviations and date separators to indicate the exact format.

Table 1. Abbreviations for date formats
Abbreviation Meaning
M Month
d Day
y Year
m Minute
s Second

Note: In IBM® SPSS® Statistics, dates from a userSource are passed to GPL as numeric values. Therefore, this function does not have any affect on a userSource.

Examples

Figure 1. Example: Indicating a date format of the form 1/31/2006
DATA: date = col(source(mydata), name("date"), unit.time(), format("M/d/yyyy"))