CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    27

    Time offset query

    Hi all,

    I'm running two labels:-

    One has the current local time updated by a timer

    The second label needs to display <local-time> minus an offset ie: 10 hours.

    How do I subtract 10 hours from the local time and display it?

    Mark

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    Code:
        Dim FirstDate As Date
        Dim SecondDate As Date
        FirstDate = Now
        SecondDate = DateAdd("h", -10, FirstDate)
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    27
    Thanks! That worked a treat!

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