Use the DateDiff function:
<quote>
Returns the number of intervals between two dates.
DateDiff(interval, date1, date2 [,firstdayofweek[, firstweekofyear]])
</quote>
'work out the duration of the call
duration = DateDiff("s", Now, vTime)
response.write duration
response.End
That will tell you how many seconds have passed. For more info on the
DateDiff function, see your WSH documentation that you downloaded and
installed from
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9
Ray at work
"Steven Scaife" <nospam> wrote in message
news:%23MEnqhybEHA.216@TK2MSFTNGP10.phx.gbl...[color=blue]
>I am trying to work out the length of time that a page was opened till it
> reached another page, I amusing the script below
>
> End_Of_Call = formatdatetime(now(), 0)
>
> 'work out the duration of the call
> duration = End_Of_Call - cdate(vTime)
> response.write isdate(End_Of_Call)
> response.write isdate(vTime)
> 'response.write duration
> response.End()
>
> but it errors and i get
>
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: '[string: "7/21/2004 2:34:49 PM"]'
> /testing/process_new.asp, line 30
>
> I cant understand why it doesn't work, it is being run on the same server
> as
> before and is identical code, except i dont use formatdatetime on both
> variables to set them, if i remove formatdatetime i still get type
> mismatch,
> any ideas how i can make this work. thanks
>
>[/color]