I found a discussion from a couple of years back regarding converting a string variable to a MM:SS variable.
and i went to raynald's helpful site.
But from these, I still can't quite figure out how to go from variables that SPSS are reading as HH:MM:SS to MM:SS.
I need SPSS to know that of 29:35 is 0 hours, 29 minutes, 35 seconds. not 29 hours, 35 minutes
It seems as if every other combination of time is available in the wizard but this one.
thanks in advanced.
Carol
|
Administrator
|
Please specify the format of your current data?
If it is a string then parse it in the same way as OP in the thread you post. If it is EXCEL or such then it will likely read as HH:MM. --- If you have something which stubbornly resists gentle coercion into compliance with your desires. Then: Roll with the punches and divide the damned thing by 60 ;-)))) 29:35 /60 --> 00:29:35 -------
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by parisec
Try this (tested), assumes string variables of 5 characters with values in each one in the format mm:ss (i.e. 02:07 not 2:07 or 2:7) compute mins=numeric(substr(strdt,1,2),F2.0). compute secs=numeric(substr(strdt,4,2),F2.0). compute mstime=time.hms(0,mins,secs). format mstime (time8). freq mstime. Melissa From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Parise, Carol A. I found a discussion from a couple of years back regarding converting a string variable to a MM:SS variable. and i went to raynald's helpful site. But from these, I still can't quite figure out how to go from variables that SPSS are reading as HH:MM:SS to MM:SS. I need SPSS to know that of 29:35 is 0 hours, 29 minutes, 35 seconds. not 29 hours, 35 minutes It seems as if every other combination of time is available in the wizard but this one.
thanks in advanced. Carol PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. |
In reply to this post by David Marso
Ah..imported from excel which means it is HH:MM
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, September 25, 2012 11:20 AM To: [hidden email] Subject: Re: Convert HH:MM:SS to MM:SS Please specify the format of your current data? If it is a string then parse it in the same way as OP in the thread you post. If it is EXCEL or such then it will likely read as HH:MM. --- If you have something which stubbornly resists gentle coercion into compliance with your desires. Then: Roll with the punches and divide the damned thing by 60 ;-)))) 29:35 /60 --> 00:29:35 ------- parisec wrote > I found a discussion from a couple of years back regarding converting > a string variable to a MM:SS variable. > > http://spssx-discussion.1045642.n5.nabble.com/Custom-Format-Time-Varia > ble-td1087201.html > > and i went to raynald's helpful site. > > But from these, I still can't quite figure out how to go from > variables that SPSS are reading as HH:MM:SS to MM:SS. > > I need SPSS to know that of 29:35 is 0 hours, 29 minutes, 35 seconds. > not > 29 hours, 35 minutes > > It seems as if every other combination of time is available in the > wizard but this one. > > thanks in advanced. > > Carol ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Convert-HH-MM-SS-to-MM-SS-tp5715258p5715259.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 [hidden email] (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 |
Please note that I am off-site at a workshop on Wednesday September 26 with limited access to my email. I will respond to your email updon my return to the office on Thursday September 27.
Thanks, Valerie Villella ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
Administrator
|
In reply to this post by parisec
So, If you divide by 60 it will turn what presently appears as 29:35 (HH:MM) into 00:29:35 (HH:MM:SS).
--
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
I am currently out of the office and will return Thursday, Sept. 26. I will respond to your email upon my return. If you need immediate assistance,
please call 812-856-5824.
Thank you, Shimon Sarraf Center for Postsecondary Research Indiana University Bloomington
|
In reply to this post by David Marso
yep. i will slither away now ;-)
thanks a bunch. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, September 25, 2012 2:11 PM To: [hidden email] Subject: Re: Convert HH:MM:SS to MM:SS So, If you divide by 60 it will turn what presently appears as 29:35 (HH:MM) into 00:29:35 (HH:MM:SS). -- parisec wrote > Ah..imported from excel which means it is HH:MM > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of David Marso > Sent: Tuesday, September 25, 2012 11:20 AM > To: > SPSSX-L@.UGA > Subject: Re: Convert HH:MM:SS to MM:SS > > Please specify the format of your current data? > If it is a string then parse it in the same way as OP in the thread > you post. > If it is EXCEL or such then it will likely read as HH:MM. > --- > If you have something which stubbornly resists gentle coercion into > compliance with your desires. > Then: Roll with the punches and divide the damned thing by 60 ;-)))) > 29:35 /60 --> 00:29:35 > ------- > > > parisec wrote >> I found a discussion from a couple of years back regarding converting >> a string variable to a MM:SS variable. >> >> http://spssx-discussion.1045642.n5.nabble.com/Custom-Format-Time-Vari >> a >> ble-td1087201.html >> >> and i went to raynald's helpful site. >> >> But from these, I still can't quite figure out how to go from >> variables that SPSS are reading as HH:MM:SS to MM:SS. >> >> I need SPSS to know that of 29:35 is 0 hours, 29 minutes, 35 seconds. >> not >> 29 hours, 35 minutes >> >> It seems as if every other combination of time is available in the >> wizard but this one. >> >> thanks in advanced. >> >> Carol > > > > > > ----- > Please reply to the list and not to my personal email. > Those desiring my consulting or training services please feel free to > email me. > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/Convert-HH-MM-SS-to-MM-S > S-tp5715258p5715259.html Sent from the SPSSX Discussion mailing list > archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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@.UGA > (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Convert-HH-MM-SS-to-MM-SS-tp5715258p5715265.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 [hidden email] (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 |
Administrator
|
I suspect one's first impulse is to divide by 100 and then start smashing things when 29:35 turns into 0:17:45 . Why is my cat hiding under the chair? ;-)))
<RANT> I've been having my share of face palm the past week attempting to convert some ugly scalar math into MATRIX. A(B(#i),C(#j))=M(#i,#j)?? WTF do you mean index out of bounds? You mean DESIGN doesn't create the vectors in numerical order but in the order it sees the values so I have to pad the fu<#ing vector so I can correctly index the crap later? 8 character limit on names? SET MXLOOPS=200000. Some time later. The maximum for MXLOOPS has been exceeded.... I could go on and on and on....... (at least the pay is good). I have much less hair than a week ago! </RANT> --
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by David Marso
One more date/time question.
Times range from (hh:mm:ss.s) 0:29:19.98 to 0:01:29.88 how can i convert the 1:00 to 60 minutes? The goal is to have times not turn over to an hour so that they end up like this: 29:19.98 60:29.88 my strategy was to try this: compute minutes = xdate.minute(timevariable). compute seconds=xdate.second(timevariable). this successfully created two numeric files so that the 0:01:29.88 above is now in 2 numeric fields: minutes = 60 seconds = 29.88 I then: COMPUTE TotalTime = Time.HMS (0,00,00). format TotalTime (time11). compute TotalTime = minutes+seconds. but of course, since i formatted this as HMS, my 1:29:53.88 is now 0:01:29 rather than the 0:60:29.88 which is what i was hoping to achieve. i gotta be missing something simple here. thanks carol -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, September 25, 2012 2:11 PM To: [hidden email] Subject: Re: Convert HH:MM:SS to MM:SS So, If you divide by 60 it will turn what presently appears as 29:35 (HH:MM) into 00:29:35 (HH:MM:SS). -- parisec wrote > Ah..imported from excel which means it is HH:MM > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of David Marso > Sent: Tuesday, September 25, 2012 11:20 AM > To: > SPSSX-L@.UGA > Subject: Re: Convert HH:MM:SS to MM:SS > > Please specify the format of your current data? > If it is a string then parse it in the same way as OP in the thread > you post. > If it is EXCEL or such then it will likely read as HH:MM. > --- > If you have something which stubbornly resists gentle coercion into > compliance with your desires. > Then: Roll with the punches and divide the damned thing by 60 ;-)))) > 29:35 /60 --> 00:29:35 > ------- > > > parisec wrote >> I found a discussion from a couple of years back regarding converting >> a string variable to a MM:SS variable. >> >> http://spssx-discussion.1045642.n5.nabble.com/Custom-Format-Time-Vari >> a >> ble-td1087201.html >> >> and i went to raynald's helpful site. >> >> But from these, I still can't quite figure out how to go from >> variables that SPSS are reading as HH:MM:SS to MM:SS. >> >> I need SPSS to know that of 29:35 is 0 hours, 29 minutes, 35 seconds. >> not >> 29 hours, 35 minutes >> >> It seems as if every other combination of time is available in the >> wizard but this one. >> >> thanks in advanced. >> >> Carol > > > > > > ----- > Please reply to the list and not to my personal email. > Those desiring my consulting or training services please feel free to > email me. > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/Convert-HH-MM-SS-to-MM-S > S-tp5715258p5715259.html Sent from the SPSSX Discussion mailing list > archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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@.UGA > (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Convert-HH-MM-SS-to-MM-SS-tp5715258p5715265.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 [hidden email] (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 |
Administrator
|
Maybe something like:
If XDATE.MINUTES(timevariable) EQ 1 timevariable=timevariable + 59*60.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by parisec
This seems like a question that is based on a misconception of
what "formatting" does. And then it adds in further confusion. See comments inserted below -- > Date: Mon, 1 Oct 2012 12:48:35 -0700 > From: [hidden email] > Subject: Re: Convert HH:MM:SS to MM:SS > To: [hidden email] > > One more date/time question. > > Times range from (hh:mm:ss.s) > > 0:29:19.98 to 0:01:29.88 > > how can i convert the 1:00 to 60 minutes? "How can I convert 1 minute to 60 minutes?" - David M. shows how, but if that is the intention, the old 1 minute will, properly, be displayed as 1 hour. > > The goal is to have times not turn over to an hour so that they end up like this: > > 29:19.98 > 60:29.88 > The HH:MM:SS format is a "format". If there is a format called MM:SS, then presumably *that* is what you want, as your subject line implies. However, in the HH:MM:SS format, what you see for 60:29.88 is going to be 1:00:29.88. > my strategy was to try this: > > compute minutes = xdate.minute(timevariable). > compute seconds=xdate.second(timevariable). > > this successfully created two numeric files so that the 0:01:29.88 above is now in 2 numeric fields: > > minutes = 60 > seconds = 29.88 > > I then: > > COMPUTE TotalTime = Time.HMS (0,00,00). > format TotalTime (time11). > compute TotalTime = minutes+seconds. > > > but of course, since i formatted this as HMS, my 1:29:53.88 is now 0:01:29 rather than the 0:60:29.88 which is what i was hoping to achieve. > > i gotta be missing something simple here. > > thanks If there is a format called MM:SS, then you presumably can use that. If there is not, then there is no way you are going to see that sort of output unless you generate it, on your own, as a string. -- Rich Ulrich |
I will be out of the country on business until Monday, October 8 . I will have limited email access while I'm out.
If your need is urgent, please call our switchboard and someone will direct your call: (813) 207-0332.
|
Free forum by Nabble | Edit this page |