Date calculations in SPSS

Steve Simon


This page is currently being updated from the earlier version of my website. Sorry that it is not yet fully available.

*Dear Professor Mean

Dear Stumped,

Maybe your patients were waiting for their HMO to approve a visit to a specialist.

Short explanation

**SPSS stores date/time values as the number of seconds since October 14

More details

To see what SPSS is doing

**To subtract one column of numbers from another in SPSS

If you are using dates


A common example using dates is computing length of stay in the hospital.

The data shown above represents the birthdate (dob)

The figure shown above is the dialog box that you get. Type in a new name in the TARGET VARIABLE field. The formula for computing length of stay is


which you should type into the NUMERIC EXPRESSION field. Then click on the OK button.

This figure shown above indicates that you have successfully computed length of stay as the difference between two date values. Congratulations.


Stumped Sharon is having problems with some calculations using dates in SPSS. Professor Mean explains that **SPSS stores data values as the number of seconds since October 14

Further reading

Raynald Levesque has a nice web tutorial about dates in SPSS.

  1. Dates Tutorial. Raynald Levesque. Accessed September 7


I attended a web seminar on the new enhancements in version 13.0 of SPSS software. The most notable change is in date calculations.

Date and time variables in SPSS have always been difficult. I have a web page showing some of the issues involved with computing the difference between two dates. SPSS has now added a Data and Time Wizard. Select TRANSFORM | DATE/TIME from the menu. Here’s the first dialog box from that menu.

This is a very pleasant surprise

You can find an earlier version of this page on my original website.