| Date: | Fri, 5 Dec 2008 11:28:06 -0600 |
| Reply-To: | "Marks, Jim" <Jim.Marks@lodgenet.com> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | "Marks, Jim" <Jim.Marks@lodgenet.com> |
| Subject: | Re: Extracting Time |
| In-Reply-To: | A<80126.4023.qm@web110710.mail.gq1.yahoo.com> |
| Content-Type: | text/plain; charset="us-ascii" |
If your variable is an SPSS datetime format:
COMPUTE timepart = xdate.time(start_time).
FORMAT timepart (time6).
This will give you the time formatted as hh:mm.
I don't think 1:30 is a valid format for 1:30 pm in SPSS-- you could
create a string to look like that, but I'm not sure if that would help.
Jim Marks
Director of Market Research
x 1616
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Keval Khichadia
Sent: Thursday, December 04, 2008 1:01 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Extracting Time
Hi,
I have a variable Start_Time that includes the date and time of the
starting time of a class. All values are in the format
(10-OCT-2008 13:50:00). I would like to create a new variable that keeps
only the time part and also format the time so that 13:50 would be 1:50.
Thanks in advance,
Keval
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|