CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Time

  1. #1
    Join Date
    Aug 2000
    Posts
    13

    Time

    This probably sounds really silly but how can I increase a time value whilst maintaining the time rules (60 mins per hour). I noticed that I can do:

    Date + 7

    without any problems but it won't do:

    Time + 30

    Help, please!!!!


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Time

    Assuming you mean in a VB date variable, use:

    Dim dtNew as date
    Dim dtOld as date

    dtOld = Now()

    dtNew = DateAdd("n",30,dtOld)





    where "h" =hours, "n" = minutes, "s" = seconds

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Aug 2000
    Posts
    13

    Re: Time

    Excellent!! Thank you very much!!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured