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 (January 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 5 Jan 2010 15:32:44 -0600
Reply-To:     Joe Matise <snoopy369@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Matise <snoopy369@GMAIL.COM>
Subject:      Re: Hour and Minute extraction from Time
Comments: To: db <daronnebonneau@gmail.com>
In-Reply-To:  <36d45d6b-8948-4688-814a-645b4a530b9d@34g2000yqp.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

If it's actually a TIME variable [a number] and not a char variable, you can use hour() or whatnot [there's one for minute() and second() as well] to extract it. hourvar = hour(timevar); No idea what else you mean by extract time, so perhaps you will want to post back to the list with more specific desired results [ie, what you actually want to get back in the same form as you posted your data] if this isn't enough.

-Joe

On Tue, Jan 5, 2010 at 3:28 PM, db <daronnebonneau@gmail.com> wrote:

> Hi, I have a variable called Time with following format and would like > to extract hour:time only so I can group by hour_time. > Could you tell me how to extract hour and time from this Time > variable ? Thanks > > Time > 23:59:58.345 > 23:59:59.234 > 0:00:00.306 > 0:00:00.373 > 0:00:00.373 > . > . > . > 01:00:00.765 >


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