Use Timer to get time 40mins from now

C

Colin Steadman

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
 
C

Colin Steadman

I've cracked it with TimeSerial:

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

Evertjan.

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?

<%

ti = DateAdd("n", 40, Now)

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

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

%>
 
B

Bob Barrows

Colin said:
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
 
C

Colin Steadman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top