Use Timer to get time 40mins from now

Discussion in 'ASP General' started by Colin Steadman, Jan 8, 2004.

  1. 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
     
    Colin Steadman, Jan 8, 2004
    #1
    1. Advertising

  2. I've cracked it with TimeSerial:

    response.write TimeSerial(hour(time), Minute(time) + 40,
    Second(time))
     
    Colin Steadman, Jan 8, 2004
    #2
    1. Advertising

  3. Colin Steadman

    Evertjan. Guest

    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))

    %>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jan 8, 2004
    #3
  4. Colin Steadman

    Bob Barrows Guest

    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.
     
    Bob Barrows, Jan 8, 2004
    #4
  5. > 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
     
    Colin Steadman, Jan 9, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    761
    Kelsang Wangchuk
    Jul 31, 2003
  2. Replies:
    1
    Views:
    1,687
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  3. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,269
    Bruce Barker
    Nov 4, 2005
  4. flamesrock
    Replies:
    8
    Views:
    553
    Hendrik van Rooyen
    Nov 24, 2006
  5. Replies:
    8
    Views:
    638
    Jorgen Grahn
    Jul 15, 2013
Loading...

Share This Page