LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 29 Sep 2009 08:42:16 -0700
Reply-To:     "Parise, Carol A." <PariseC@sutterhealth.org>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Parise, Carol A." <PariseC@sutterhealth.org>
Subject:      Re: recoding 24 hr time
Comments: To: "Oliver, Richard" <roliver@spss.com>
In-Reply-To:  <6CD9B6A6B6CCBA4FA497F07182F4EE8303635524@MIAEMAILEVS1.spss.com>
Content-Type: text/plain; charset="iso-8859-2"

Hi all,

I received a solution offline which worked:

COMPUTE test1 = TIME.HMS(00,00,00) . FORMAT test1 (TIME10). COMPUTE test2 = TIME.HMS(00,00,00) . FORMAT test2 (TIME10). IF (test1=TIME.HMS(00,00,00)) test2=TIME.HMS(24,00,00).

But both of are great succint solutions.

Thanks so much for the replies. Carol

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Oliver, Richard Sent: Tuesday, September 29, 2009 7:57 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: recoding 24 hr time

First, my apologies for my earlier "solution" for a completely different problem. I should have read the post more carefully.

Second, the solution below is correct, but note that there is a slightly simpler (but arguably more cryptic) solution:

if timevar=0 timevar=86400.

This could also be expressed in a Recode:

recode timevar (0=86400).

Internally, times are stored as a number of seconds, and there are 86400 seconds in a day.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Spousta Jan Sent: Tuesday, September 29, 2009 4:01 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: recoding 24 hr time

Hi Carol,

Suppose your variable is in an appropriate date format. Then try:

if (timevar = TIME.HMS(0,0,0) ) timevar = TIME.HMS(24,0,0) . EXECUTE .

Hope this helps,

Jan

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Parise, Carol A. Sent: Monday, September 28, 2009 9:00 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: recoding 24 hr time

Hi all,

i have data in 24-hr time where 12:00 AM is = 00:00:00.

how can i convert this so that 12:00 AM is 24:00:00?

i tried this:

recode mytime (TIME.HMS(0,0,0)=TIME.HMS(24,0,0)).

with no success. any ideas?

thanks Carol

===================== 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

_____________ Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

Are you sure that you really need a print version of this message and/or its attachments? Think about nature.

-.- --

===================== 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

===================== 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


Back to: Top of message | Previous page | Main SPSSX-L page