Time in a Date format

Time in a Date format

Post by MSchneid » Sat, 26 Jul 2003 12:24:43



While reading an Excel file into SPSS v.11.5 as a database query, everything
works fine except for a column/variable showing the Time of day for each
record, in the form....
6:03 AM
4:43 PM
10:28 PM, etc.

SPSS reads the Time in as a Date field format, all with the following date in
1899 followed by the correct time, extended with 00 seconds, as in....
30-DEC-1899 6:03:00
30-DEC-1899 4:43:00
30-DEC-1899 10:28:00, etc.

I've transformed the times in Excel into military time and read the file into
SPSS again to no avail, as I still get the same result. I'd appreciate any
advice how to get the original Time data in SPSS with an AM / PM indicator --
even military time and retaining the seconds would be OK, just not the 1899
date!  Thanks.

Mark Schneider

 
 
 

Time in a Date format

Post by Fre » Sat, 26 Jul 2003 18:49:10


Import the time as you did previosuly then

comp TIME=xdate.time(DATE).
format TIME (time8).

will give you just the time from the date ant time


> While reading an Excel file into SPSS v.11.5 as a database query, everything
> works fine except for a column/variable showing the Time of day for each
> record, in the form....
> 6:03 AM
> 4:43 PM
> 10:28 PM, etc.

> SPSS reads the Time in as a Date field format, all with the following date in
> 1899 followed by the correct time, extended with 00 seconds, as in....
> 30-DEC-1899 6:03:00
> 30-DEC-1899 4:43:00
> 30-DEC-1899 10:28:00, etc.

> I've transformed the times in Excel into military time and read the file into
> SPSS again to no avail, as I still get the same result. I'd appreciate any
> advice how to get the original Time data in SPSS with an AM / PM indicator --
> even military time and retaining the seconds would be OK, just not the 1899
> date!  Thanks.

> Mark Schneider


 
 
 

Time in a Date format

Post by MSchneid » Sun, 27 Jul 2003 11:44:58


Thanks for the tip, Fred.

Mark

>Subject: Re: Time in a Date format

>Date: 7/25/2003 5:49 AM Eastern Daylight Time

>Import the time as you did previosuly then

>comp TIME=xdate.time(DATE).
>format TIME (time8).

>will give you just the time from the date ant time