Military Time (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


rickyzicky -> Military Time (12/6/2001 3:20:58)


What is the best way to calculate time using military time.

I need to calculate time spent.
Though it is easy to calculate time spent if the hour started was 1600 hours and time ended was 1800 hours.

But how do I tackle the problem when the hour started is 2300 and the hour ended was 0100 hours. I need this to calsulate to 2hours. Once we are past 2400 it gets tougher (at least for me).

Any ideas ?




rdouglass -> RE: Military Time (12/6/2001 8:24:56)

I think it depends on how you're storing your time values.

If I was doing it I would calculate the diff between time AND date like:

Set a variable ie. myTime
Subtract dates.
myTime = results multiplied by 24.
Subtract times.
Add to myTime
Format myTime and season to taste....


Does this make sense???

 




Spooky -> RE: Military Time (12/8/2001 1:18:50)

Heres some datae related stuff :

http://msdn.microsoft.com/scripting/vbscript/doc/vbstoc.htm

http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=3

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875