SPSS date variables are not hard to work with if you understand some basics. This tutorial walks you through them by showing some simple data examples.

Read more...

Read more...

SPSS date calculations are much easier than they may seem at first. The first key to success is understanding what SPSS date variables really are. Next, choose (and possibly combine) the right date functions. This tutorial will walk you through the main ones.

Read more...

For time calculations (such as the number of days between two dates) proper date variables are needed. In some cases, the digits of a numeric variable may represent year, month and day. This tutorial shows how to convert this format into an actual date variable.

Read more...

Extracting the year (or any component) from a date is straightforward with the XDATE function.

Read more...

Read more...

SPSS computes wrong weeknumbers: some weeks consist of just 1 day. There seems to be no solution for computing correct ISO week numbers.

Read more...

Read more...

For converting string variables to date variables, ALTER TYPE is the way to go. This tutorial demonstrates how to do this and points out a couple of caveats. For those who can't use ALTER TYPE, we'll propose some alternatives.

Read more...

Read more...

Converting a string variable into an SPSS date variable isn’t hard if you combine the right tools. Step-by-step tutorial with downloadable data file.

Read more...

Read more...

## THIS TUTORIAL HAS 3 COMMENTS:

## By Amy on June 20th, 2018

14th October 1582 is the exact timepoint that SPSS uses to calculate it's date in seconds from. Just in case anyone wants to recode a date variable using syntax. You will need this date.

## By Ruben Geert van den Berg on June 20th, 2018

Hi Amy!

If you'd like to RECODE a date variable, you could do so by recoding the underlying numbers which you'll see after running something like

FORMATS mydate(f16).

However, the more likely solution for this is using DATE.DMY combined with IF as in

IF(mydate > DATE.DMY(1,1,2018)) outputvariable = ....

For recoding date

ranges, try IF with RANGE with DATE.DMY.Hope that helps!

## By Amy on July 3rd, 2018

Thanks Ruben! Helpful stuff - you really are a bit of an SPSS guru ;)