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.
use hh:mm:ss
--------------------- IconTextBox Custom Control DropDown ListView Custom Control
If you want to show AM or PM then Format(Now, "hh:mm:ss AM/PM")
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Private Message Viewer • Copy/Paste VB Code • Paste VB Code Add-In • Insert Procedure Names Add-In • A calculator for the game of Spider • My review of REALbasic 2008 • VB6 Debug Tutorial • Picture/Video Viewer • VBF Photo Contest Winners 2009 - 2016
This will show 0 at midnight. VB Code: Option Explicit Private Sub Form_Load() the lblTime.Caption = Hour(Now) Mod 12 End Sub
Option Explicit Private Sub Form_Load() the lblTime.Caption = Hour(Now) Mod 12 End Sub
How does that help? Why would you want to do that?
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.
Where does he say anything about zero?
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.
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.
Sorry it took so long to reply, mostly its just for learning experience :-p. Thanks a lot for all your help, AGAIN!
Forum Rules