Return Server Time + two hours?

Discussion in 'ASP General' started by Bill, Mar 15, 2006.

  1. Bill

    Bill Guest

    In ASP, how can I quickly return the server time + 2 hours, using VBScript?

    With TIME(), I've found functions for date arithmetic, but I can't find anything for
    time arithmetic.

    Thanks!!!
     
    Bill, Mar 15, 2006
    #1
    1. Advertising

  2. Bill wrote:
    > In ASP, how can I quickly return the server time + 2 hours, using
    > VBScript?
    >
    > With TIME(), I've found functions for date arithmetic, but I can't
    > find anything for time arithmetic.
    >
    > Thanks!!!

    t=dateadd("hh",2,now())
    --
    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 [MVP], Mar 15, 2006
    #2
    1. Advertising

  3. Bill

    Bill Guest

    I changed it to:

    t=dateadd("hh",2,time())

    and it does what I want, THANKS!!!



    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > Bill wrote:
    > > In ASP, how can I quickly return the server time + 2 hours, using
    > > VBScript?
    > >
    > > With TIME(), I've found functions for date arithmetic, but I can't
    > > find anything for time arithmetic.
    > >
    > > Thanks!!!

    > t=dateadd("hh",2,now())
    > --
    > 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.
    >
    >
     
    Bill, Mar 15, 2006
    #3
  4. Bill

    Larry Bud Guest

    Bill wrote:
    > I changed it to:
    >
    > t=dateadd("hh",2,time())
    >
    > and it does what I want, THANKS!!!
    >


    You don't need the date? What happens at 11pm?
     
    Larry Bud, Mar 16, 2006
    #4
    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. =?Utf-8?B?UGV0ZXI=?=

    TimeOfDay.Hours doesn't return right value

    =?Utf-8?B?UGV0ZXI=?=, Jun 9, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,100
    =?Utf-8?B?UGV0ZXI=?=
    Jun 10, 2004
  2. Rahmi Acar
    Replies:
    0
    Views:
    563
    Rahmi Acar
    Jul 17, 2003
  3. Ray Wood

    Time on Update is exactly 3 hours less than time entered

    Ray Wood, Jul 17, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    167
    Ray Wood
    Jul 17, 2003
  4. Sijo Kg
    Replies:
    6
    Views:
    144
    Florian AƟmann
    Feb 15, 2009
  5. rutherf
    Replies:
    2
    Views:
    431
    rutherf
    Oct 28, 2006
Loading...

Share This Page