Working with a Security Monitoring client, this comes up incredibly often. OLD.TIME=TIME()+(DATE()*86400) NEW.TIME=TIME()+(DATE()*86400)
DIFF=NEW.TIME-OLD.TIME provided that OLD.TIME was established prior and held somewhere. Some view this calculation as flawed as the DATE() portion assumes that the date has completed. But since it's being mis-used twice, they cancel themselves out and the DIFF number of seconds is accurate. (No flames please on double negatives.) PS. You do not need to use timedate unless you may be establishing one of the times very, very, very near midnight. In all of my years of using the aforementioned method, I have never had instanteously generated TIME() and DATE() functions split the absolute hair at midnight. Meaning that while the TIME() function which should grab 23:59:59 had some delay that the immediately following DATE() function grabbed the following day instead of the day the 23:59 was in. Midnight is also somehow ambiguous and troublesome as a time value. Be careful My 23:59 cents Mark Johnson ----- Original Message ----- From: "Manu Fernandes" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, November 09, 2006 6:14 AM Subject: Re: [U2] Difference between two TIMEDATES in seconds > re, > a little expression > > * 11:31:41 16 Mar 2007 timedate() sample > * A = TIMEDATE() 1 > * B = TIMEDATE() 2 > *----------------- > BD = (ICONV(OCONV(A,'G1 3'),'D') * 86400) > ED = (ICONV(OCONV(B,'G1 3'),'D') * 86400) > BT = ICONV(OCONV(A,'G0:3'),'MTS') > ET = ICONV(OCONV(B,'G0:3'),'MTS') > DIFF = (ED - BD ) + (ET - BT) > > you can do it with a IType > > I hope this help... > > Manu > ----- Original Message ----- > From: "Marco Manyevere" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, March 16, 2007 11:24 AM > Subject: [U2] Difference between two TIMEDATES in seconds > > > > Hello everyone, > > > > Can someone help me with this. I need a way to calculate the difference > > between two TIMEDATE() and return the results in seconds. The biggest > > difference I expect between the two time dates is 100 days. > > > > Thanks and regards, Marco. > > > > > > > > ___________________________________________________________ > > The all-new Yahoo! Mail goes wherever you go - free your email address > > from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html > > ------- > > u2-users mailing list > > [email protected] > > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
