Skip to main content
guest
Join
|
Help
|
Sign In
RockyVB
Home
guest
|
Join
|
Help
|
Sign In
Wiki Home
Recent Changes
Pages and Files
Members
Home
Handy Hint Example
Handy Hints
Great Code
Good VB Resources
Instructor Resources
How to use Wikispaces
2010_S2_Lamb_Josh_HH_1
Edit
0
1
…
1
Tags
handy hint 1 josh lamb
Notify
RSS
Backlinks
Source
Print
Export (PDF)
Handy Hint 1 Displaying time formats
To display the current time in 12hr format the code will be
[your textbox name].text = TimeOfDay.ToString(
"hh:mm:ss"
)
To display the current time in 24hr format the code will be
[your textbox name].text = TimeOfDay.ToString(
"HH:mm:ss"
)
'note the 24 hr format use's "HH" and the 12hr format uses lower case letters, this lets vb know it is ment to be 24hr format not 12hr.'
Javascript Required
You need to enable Javascript in your browser to edit pages.
help on how to format text
Turn off "Getting Started"
Home
...
Loading...
To display the current time in 12hr format the code will be
[your textbox name].text = TimeOfDay.ToString("hh:mm:ss")
To display the current time in 24hr format the code will be
[your textbox name].text = TimeOfDay.ToString("HH:mm:ss")
'note the 24 hr format use's "HH" and the 12hr format uses lower case letters, this lets vb know it is ment to be 24hr format not 12hr.'