User Guide

152
Chapter 7
Extract a part of a date or time variable. This option allows you to extract part of a
date/time v
ariable, such as the day of the month from a date/time variable, which
has the form mm/dd/yyyy.
Assign periodicity to a data set. This choice takes you to the Define Dates dialog
box, used to create date/time variables that consist of a set of sequential dates.
This featur
e is typically used to associate dates with time series data.
Note: Tasks are disabled when the data set lacks the types of variables required to
accomplish the task. For instance, if the data set contains no string variables, then the
task to cre
ate a date/time variable from a string does not apply and is disabled.
Dates and Times in SPSS
Variables that represent dates and times in SPSS have a variable type of numeric, with
display fo
rmats that correspond to the specific date/time formats. These variables are
generally referred to as date/time variables. SPSS distinguishes between date/time
variables that actually represent dates and those that represent a time duration that is
independ
entofanydate,suchas20hours,10minutesand15seconds.Thelatterare
referred to as duration variables and the former as date or date/time variables. For a
complete list of display formats, see “Date and Time” in the “Universals” section of
the SPSS
Command Syntax Reference.
Date and
date/time va riables.
Date variables have a format representing a date, such as
mm/dd/yyyy. Date/time variables have a format representing a date and time, such
as dd-mmm-yyyy hh:mm:ss. Internally, date and date/time variables are stored as
the num
ber of seconds from October 14, 1582. Date and date/time variables are
sometimes referred to as date-format variables.
Both two- and four-digit year specifications are recognized. By default, two-digit
years r
epresent a range beginning 69 years prior to the current date and ending 30
years after the current date. This range is determined by your Options settings
and is configurable (from the Edit menu, choose
Options and click the Data tab).