Results 1 to 7 of 7

Thread: time format in vb...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506

    Talking time format in vb...

    k, im tryin to make a program that does a logging process and am using Time before what it logs, but my Time always comes out in 24 hour, anyway of changing it to 12 hour?

  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 format in vb...

    Originally posted by adzzzz
    k, im tryin to make a program that does a logging process and am using Time before what it logs, but my Time always comes out in 24 hour, anyway of changing it to 12 hour?
    i think that is in your system settings...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    tried that, my sstem clock in bottom right is in 12 hour

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim MyTime As Variant
    3. MyTime = Format(Time, "hh:mm:ss AMPM")
    4. MsgBox MyTime
    5. End Sub

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Hack
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim MyTime As Variant
    3. MyTime = Format(Time, "hh:mm:ss AMPM")
    4. MsgBox MyTime
    5. End Sub
    yeah that works.. but if you call the time function and your system settings are on 12 hour.. why would it return military time???

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    cheers :>

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Originally posted by kleinma
    yeah that works.. but if you call the time function and your system settings are on 12 hour.. why would it return military time???
    I don't think so, but it would make an interesting test.

    Anyway, I was just using the Time Function in my example. If you used that routine for real, then you would probably have the time stored in a variable, which could be more easily manipulated.

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