Solved

Format timeofday to 24hour

Posted on 2014-03-30
5
381 Views
Last Modified: 2014-03-30
I am trying to modify this code bit to display the time in military time (24hour)
 
lblClock.Text = TimeOfDay
0
Comment
Question by:mickeyshelley1
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39965206
lblClock.Text = Format(TimeOfDay, "hh:nn")

Open in new window

0
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 500 total points
ID: 39965229
Hi mickeyshelley1,

Please check the below link.

12/24 Hour Time format:

http://www.codeproject.com/Tips/206348/Hour-Time-format
0
 

Author Comment

by:mickeyshelley1
ID: 39965240
When i run lblClock.Text = Format(TimeOfDay, "hh:nn") i get 02:nn displayed
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39965245
Sorry, didn't realize it was .Net.
0
 

Author Closing Comment

by:mickeyshelley1
ID: 39965257
Solution:  lblClock.Text = Format(DateTime.Now.ToString("HH:mm:ss") & "") ')'
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Definitions and default visual studio colors 5 66
Put window Form inside tab page 10 33
Get hold of longitude and latitude in iframe string 11 46
Regex validation 2 25
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question