Velocity Reviews > Use Timer to get time 40mins from now

# Use Timer to get time 40mins from now

Guest
Posts: n/a

 01-08-2004
Is it possible to convert a value from timer into a real
time (HH:MM:SS)? This is what I'm trying to do -

timeIn40mins = timer + 2400
Response.Write "time + 40 = " & timeConvert(timeIn40mins)

But I dont know what timeConvert should be. Alternatively
is there another way of doing this?

TIA,

Colin

Guest
Posts: n/a

 01-08-2004
I've cracked it with TimeSerial:

response.write TimeSerial(hour(time), Minute(time) + 40,
Second(time))

Evertjan.
Guest
Posts: n/a

 01-08-2004
Colin Steadman wrote on 08 jan 2004 in
microsoft.public.inetserver.asp.general:

> Is it possible to convert a value from timer into a real
> time (HH:MM:SS)? This is what I'm trying to do -
>
> timeIn40mins = timer + 2400
> Response.Write "time + 40 = " & timeConvert(timeIn40mins)
>
> But I dont know what timeConvert should be. Alternatively
> is there another way of doing this?
>

<%

function two(x)
two = right("0" & x, 2)
end function

Response.Write two(hour(ti))&":"&two(minute(ti))&":"&two(second(t i))

%>

--
Evertjan.
The Netherlands.

Bob Barrows
Guest
Posts: n/a

 01-08-2004
> Is it possible to convert a value from timer into a real
> time (HH:MM:SS)? This is what I'm trying to do -
>
> timeIn40mins = timer + 2400
> Response.Write "time + 40 = " & timeConvert(timeIn40mins)
>
> But I dont know what timeConvert should be. Alternatively
> is there another way of doing this?
>

I'm not clear: do you want the time of day?

Or do you simply want the seconds expressed as H:M:S? IE, 93672 seconds
expressed as 26:01:12?

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Guest
Posts: n/a

 01-09-2004
> I'm not clear: do you want the time of day?
>
> Or do you simply want the seconds expressed as H:M:S? IE, 93672 seconds
> expressed as 26:01:12?
>
> Bob Barrows

Yes, thats what I was after, a time of day (time now + 40 minutes).
This is allows me to warn the user exactly when a certain page will
timeout. That way there is no ambiguity, and if the page does timeout
the user cant say they were not warned.

Regards,

Colin