Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time difference

Status
Not open for further replies.

yahve

Programmer
Nov 14, 2000
159
CA
Hi,

I'm writing an HTA and using VBScript to calculate the time the window stays open. I'm using the DateDiff function to get the elapsed time. What I'm looking for is help in formating the output of DateDiff in something like hh:mm:ss.

Any suggestion?

Thanks.
 
Isn't it something as simple as
FormatDateTime(Date, 3)
or
FormatDateTime(Date, 4)

 
Hi,

Thanks, I tried and it did NOT work. The 2 times I'm comparing in seconds are one variable and one is Now().

Bye.
 
U could USE JavaScript... cuz in VBScript u have to implement your own FormatDateTime function
 
Hi,

I've figured it out, it works using:

...
starttime = Now()
starttime = CDate(latime)
...
endtime = Now()
endtime = CDate(endtime)
elapse = endtime - starttime
elapse = CDate(elapse)
...

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top