Dates and times

Formats

There are three common formats across SAS, SPSS and Stata.

Date (number of days)

  • SAS: MMDDYY, DDMMYY, YYMMDD, DATE
  • SPSS: n/a
  • Stata: %td

Time (number of seconds):

  • SAS: TIME, HHMM, TOD
  • SPSS: TIME, DTIME
  • Stata: n/a

DateTime (number of seconds):

  • SAS: DATETIME
  • SPSS: DATE, ADATE, SDATE, DATETIME (as milliseconds)
  • Stata: %tc, %tC

Offsets

Dates and date times use a difference offset to R:

  • SAS: 1960-01-01 (3653 days)
  • SPSS: 1582-10-14. (141428 days)
  • Stata: 1960-01-01. (3653 days)