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 (April 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 16 Apr 2007 18:20:05 -0400
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Exact hourly value
Comments: To: Xiao Tang <glionswiss@GMAIL.COM>

Xiao,

As Raghav already pointed out, the time part is showing the number of seconds expired during the day. If you are looking to calculate the difference, simply subtract the two datetime variables. For example:

data have; input datetime1 ANYDTDTM18. datetime2 ANYDTDTM18.; elapsed_seconds=datetime2-datetime1; cards; 04mar2007:23:59:59 05mar2007:00:00:00 04mar2007:23:59:59 06mar2007:00:00:00 ; run;

HTH, Art -------- On Mon, 16 Apr 2007 15:02:47 -0400, Xiao Tang <glionswiss@GMAIL.COM> wrote:

>I have some filed like this: > >04mar2007:23:59:59 >05mar2007:00:00:00 > >I use timepart to extract hourly value and sas return the first value >equals to 86399 but return the second value equals to 0. Actually I expect >the second value could be 86400. Why the second value could be 0. Thanks, > >Xiao


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