469,353 Members | 2,061 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

Use Timer to get time 40mins from now

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
Jul 19 '05 #1
4 1348
I've cracked it with TimeSerial:

response.write TimeSerial(hour(time), Minute(time) + 40,
Second(time))
Jul 19 '05 #2
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(t i))

%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
Colin Steadman wrote:
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.
Jul 19 '05 #4
> 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
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Christine | last post: by
1 post views Thread by martinm69x | last post: by
7 posts views Thread by Mike Eaton | last post: by
4 posts views Thread by Liverpool fan | last post: by
4 posts views Thread by Daniel | last post: by
2 posts views Thread by martin1 | last post: by
19 posts views Thread by adi | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.