Caculating hours??

1. Senior Member
Join Date
Dec 1969
Posts
118

## Caculating hours??

Hey friendz,<BR> is there a way tt i can calculate hours? Like timeIn is at 9:00:00 AM and timeOut is 6:00:00 PM! Is there a way to caculate the time bet them????? And how to add all the time together??? Isn&#039t this difficult?? Well maybe my asp knowledge is not up to standard! I had try but still cannot! I hope someone will give me some advise on this.. Thanks...

2. Ritesh Guest

## RE: Caculating hours??

That should not be difficult.<BR>hour(now) will give you the current hour.<BR><BR>You have not stated exactly what problem you are facing but I guess this should help.

3. Senior Member
Join Date
Dec 1969
Posts
118

## RE: Caculating hours??

u see! I got the time display in my broswer! There are a timeIn and a timeOut! So i want to get a total hours that the person work that day! And timeIn is like time reporting work and timeOut is time he knock off.. so i wanna know how many hours he work that day.. =)

4. Ritesh Guest

Try this link:<BR>It has got many time related scripts. I hope you can find the one you need.<BR><BR>http://wsabstract.com/script/cutindex1.shtml<BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
118

Ok hope it helps hee

6. shaffer Guest

## RE: Caculating hours??

Why not just use the DATEDIFF function?<BR><BR>e.g.<BR><BR>ElapsedHours = DateDiff("h", date1, date2)<BR><BR>Does this help?<BR><BR> -Mike

7. Senior Member
Join Date
Dec 1969
Posts
118

## RE: Caculating hours??

mike, sorry i wasn&#039t here! <BR><BR>Well is there this functio in asp???<BR>and: ElapsedHours = DateDiff("h", date1, date2)<BR><BR>"h" is for???<BR>date1 & date2 is for date??

8. shaffer Guest

## RE: Caculating hours??

Hi Anthony,<BR><BR>Of course there is that function in VBScript, otherwise I wouldn&#039t have suggested it. :)<BR><BR>"h" means show the difference in hours between the two dates.<BR><BR>I would suggest that you look at:<BR><BR>http://help.activeserverpages.com/iishelp/VBScript/htm/VBStoc.htm<BR><BR>and look up the DateDiff function, if you are unfamiliar with it.<BR><BR>Hope this helps!<BR><BR> - Mike<BR>

9. Senior Member
Join Date
Dec 1969
Posts
118

## RE: Caculating hours??

Thanks mike.. =)<BR><BR>That web site really helps...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•