TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: Steve Gerrard
date: 2004-07-04 06:00:00
subject: Re: Calculating Time

"Rick Rothstein"  wrote in message
news:acKdnVhoyeXL6XrdRVn-jg{at}comcast.com...
> > I need to calculate the difference between a start time in either am
> > or pm, and an ending time in either am or pm.  Does anyone know of a
> > way to calculate this so that I can have a final product of _hours
and
> > _minutes?
>
> Use the DateDiff function to calculate difference in minutes, take
that
> result and divide it by 60 to find the number of hours. Subtract 60
> times the number of hours from the total difference in minutes to get
> the number of minutes.
>
> Rick - MVP
>

If you are fussy, you might not like this result:

?DateDiff("n", "10:56:59 pm",  "11:56:00 pm")
 60
when it is really 59 min, 1 sec.

So it might be better to get the difference in seconds and divide by 60
to get minutes:
?DateDiff("s", "10:56:59 pm",  "11:56:00 pm")/60
 59.0166666666667

which will round off to 59 minutes.
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com

---
 * RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
 * RgateImp.MoonDog.BBS at 7/4/04 6:00:11 AM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.