Results 1 to 3 of 3

Thread: Time - 4

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    8

    Question Time - 4

    Hello

    I have following piece of code...

    dateT = Now().ToString("hh:mm tt")

    I want to change it to -4 hours .. I want to show current time - 4 hours

    How is this possible ?

    Regards,
    Calm

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Time - 4

    you use addhours, but pass a negative

    Code:
            Dim MyTime As DateTime = DateTime.Now.AddHours(-4)
            MessageBox.Show(MyTime.ToString("hh:mm tt"))

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    8

    Re: Time - 4

    Thanks Kleinma... It worked

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