Results 1 to 10 of 10

Thread: [RESOLVED] VB6 Time Formats

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    17

    Resolved [RESOLVED] VB6 Time Formats

    After you use the lblTime.Caption = Format(Time, ) to display only the hour is there any way you can show only hours up to 12? Then go back to 1?

    Thanks again.

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: VB6 Time Formats

    use hh:mm:ss

  3. #3

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: VB6 Time Formats

    This will show 0 at midnight.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  the lblTime.Caption = Hour(Now) Mod 12
    5. End Sub

  5. #5

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: VB6 Time Formats

    Quote Originally Posted by koolzap351
    After you use the lblTime.Caption = Format(Time, ) to display only the hour is there any way you can show only hours up to 12? Then go back to 1?

    Thanks again.

    Looks like what he wants.

  7. #7

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: VB6 Time Formats

    I was just letting him know that there is a 0:00 even if he stops at 12. You can't go back to 1 after 23:59.

  9. #9
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: VB6 Time Formats

    Yeah, but I think that AM/PM version goes back to 12:00 AM after 11:59 PM. I actualy hate this. I like the 24 hour format.

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    17

    Re: VB6 Time Formats

    Sorry it took so long to reply, mostly its just for learning experience :-p. Thanks a lot for all your help, AGAIN!

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