Developer Documentation Library > Data Model > Available DSCs > SPSS Statistics SAV DSC > Writing to an SPSS Statistics .sav file > Variable definitions when writing to a .sav file > Date variables
 
Date variables
By default, the SPSS Statistics SAV DSC assigns the DATETIME format to the corresponding IBM SPSS Statistics date variable.
To assign a different format to the IBM SPSS Statistics variable, use the Format Properties and settings used by the SPSS Statistics SAV DSC.
The following table describes how the SPSS Statistics SAV DSC converts the MDM variable's value to the IBM SPSS Statistics variable's value depending on the IBM SPSS Statistics format that has been set for the MDM variable:
IBM SPSS Statistics format (equivalent value of Format setting in parentheses)
Method of conversion to this format
TIME (21) and DTIME (25)
The MDM variable's value is multiplied by 86400.0 to produce a .sav value that represents a time interval measured in seconds.
WKDAY (26) when the value is in the range 1900-01-01 00:00:00 <= x < 1900-01-08 00:00:00 (1.0 <= x < 8.0), and MONTH (27) when the value is in the range 1900-01-01 00:00:00 <= x < 1900-01-13 00:00:00 (1.0 <= x < 13.0)
The MDM variable's value is preserved unchanged to produce a .sav value that is one of a predefined set of values. For example, a WKDAY value of 1.0 represents MONDAY and a MONTH value of 1.0 represents JANUARY. Any fractional part of the value (which is used by the MDM to indicate the time of day) is also preserved.
WKDAY (26) and MONTH (27) when the value is large, and DATE (20), DATETIME (22), ADATE (23), JDATE (24), MOYR (28), QYR (29), WKYR (30), EDATE (38), and SDATE (39)
A software component that is part of the IBM SPSS Statistics program converts the MDM variable's value to the IBM SPSS Statistics floating-point representation of a particular instant in time.
If that conversion fails, it issues an error message to report the unsupported value, unless the MR Init Allow Dirty connection property (see Connection properties) is true, in which case it writes 0.0 to the .sav file.
See also
Variable definitions when writing to a .sav file