SPSS Timestamp and Unix Timestamp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SPSS Timestamp and Unix Timestamp

Mike P-5
Hi All,

I've just imported a file which has a time variable based on the UNIX
timestamp system (1 Jan 1970 00:00) in seconds,
Reading about this variable it looks as if it does not contain any leap
seconds within this time, does anybody know if SPSS records leap seconds
from $time system function or not?

While I'm at it I might as well ask if anyone has done any type of
calculation like this before, and if so can I get a copy of the code? If
not don't worry

Mike

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: SPSS Timestamp and Unix Timestamp

Peck, Jon
If you get current time from SPSS, it takes the system time, whatever it is.  Time calculations within SPSS adhere to a strict 86400-second day.  Dates, of course, account for all the calendar ins and outs of leap rules.



-----Original Message-----
From: SPSSX(r) Discussion on behalf of Michael Pearmain
Sent: Tue 11/7/2006 9:08 AM
To: [hidden email]
Subject:      [SPSSX-L] SPSS Timestamp and Unix Timestamp
 
Hi All,

I've just imported a file which has a time variable based on the UNIX
timestamp system (1 Jan 1970 00:00) in seconds,
Reading about this variable it looks as if it does not contain any leap
seconds within this time, does anybody know if SPSS records leap seconds
from $time system function or not?

While I'm at it I might as well ask if anyone has done any type of
calculation like this before, and if so can I get a copy of the code? If
not don't worry

Mike

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: SPSS Timestamp and Unix Timestamp

Mike P-5
In reply to this post by Mike P-5
Thanks Jon,

I notice something when I run the following and checked it against the
UNIX system that recorded the data

COMPUTE #Unix_date = DATE.YRDAY(1970,1) .
COMPUTE Date_stamp = DATESUM(Timestamp,#Unix_date,'seconds') .
FORMATS Date_stamp (F20.0).
Then converting the numeric variable into a date (dd-mm-yyyy hh:mm:ss)

Because we have changed from BST to GMT, at the end of October I get a
one hour time difference between the two times, because the UNIX system
changes but the SPSS system will not, as you've stated below

'Time calculations within SPSS adhere to a strict 86400-second day.
Dates, of course, account for all the calendar ins and outs of leap
rules.'

So with this in mind I guess there is not a quick and easy fix to this
problem to match the two time stamps

Mike

-----Original Message-----
From: Peck, Jon [mailto:[hidden email]]
Sent: 07 November 2006 16:36
To: Michael Pearmain; [hidden email]
Subject: RE: [SPSSX-L] SPSS Timestamp and Unix Timestamp

If you get current time from SPSS, it takes the system time, whatever it
is.  Time calculations within SPSS adhere to a strict 86400-second day.
Dates, of course, account for all the calendar ins and outs of leap
rules.



-----Original Message-----
From: SPSSX(r) Discussion on behalf of Michael Pearmain
Sent: Tue 11/7/2006 9:08 AM
To: [hidden email]
Subject:      [SPSSX-L] SPSS Timestamp and Unix Timestamp

Hi All,

I've just imported a file which has a time variable based on the UNIX
timestamp system (1 Jan 1970 00:00) in seconds, Reading about this
variable it looks as if it does not contain any leap seconds within this
time, does anybody know if SPSS records leap seconds from $time system
function or not?

While I'm at it I might as well ask if anyone has done any type of
calculation like this before, and if so can I get a copy of the code? If
not don't worry

Mike

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________