Simple question from a newbie. Using VWD in VB.NET for ASP.NET.
I want to format a time value to show in military time only and without the
seconds. I know it's not {0:t} or {0:T} but I can not figure out what it is.
If it's 3:25 PM, I want it to show 15:25 only and without the seconds. This
is what I found, but it did not provide me with the Military formating. http://datawebcontrols.com/faqs/Cust...TimeData.shtml
Thanks!
Phil 8 21748
Hi,
You can try following two options:
[1]{"H:mm"}
Use uppercase H to display times based on the 24-hour clock (military
clock). Uppercase H displays single-digit hours as single-digit numbers,
without a leading zero.
[2]{"HH:mm"}
Use uppercase HH to display times based on the 24-hour clock (military
clock). Uppercase HH displays single-digit hours with a leading zero.
Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"Phillip Vong" wrote:
Simple question from a newbie. Using VWD in VB.NET for ASP.NET.
I want to format a time value to show in military time only and without the
seconds. I know it's not {0:t} or {0:T} but I can not figure out what it is.
If it's 3:25 PM, I want it to show 15:25 only and without the seconds. This
is what I found, but it did not provide me with the Military formating.
http://datawebcontrols.com/faqs/Cust...TimeData.shtml
Thanks!
Phil
Manish,
Thanks!!!!
In VWD, {H:mm} didn't work. I changed it to {0:H:mm} and it worked just
fine!
Thanks alot!!!
Phil
"Manish Bafna" <Ma*********@discussions.microsoft.comwrote in message
news:9D**********************************@microsof t.com...
Hi,
You can try following two options:
[1]{"H:mm"}
Use uppercase H to display times based on the 24-hour clock (military
clock). Uppercase H displays single-digit hours as single-digit numbers,
without a leading zero.
[2]{"HH:mm"}
Use uppercase HH to display times based on the 24-hour clock (military
clock). Uppercase HH displays single-digit hours with a leading zero.
Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"Phillip Vong" wrote:
>Simple question from a newbie. Using VWD in VB.NET for ASP.NET.
I want to format a time value to show in military time only and without the seconds. I know it's not {0:t} or {0:T} but I can not figure out what it is. If it's 3:25 PM, I want it to show 15:25 only and without the seconds. This is what I found, but it did not provide me with the Military formating.
http://datawebcontrols.com/faqs/Cust...TimeData.shtml
Thanks!
Phil
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
In VWD, {H:mm} didn't work. I changed it to {0:H:mm} and it worked just
fine!
Just in case you're intending to use this in databound controls (GridView
etc) using the DataFormatString tag, you will also need to set the
HtmlEncode tag to false or it won't work...
Mark, I did exactly that.
Can someone help me format this so it's in H:mm format? I'm using this with
a button On_Click and I'm not sure what the formatting command is.
Thanks!
Dim CurTime As DateTime = DateTime.Now
TextBox1.Text = CurTime
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uH**************@TK2MSFTNGP06.phx.gbl...
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
>In VWD, {H:mm} didn't work. I changed it to {0:H:mm} and it worked just fine!
Just in case you're intending to use this in databound controls (GridView
etc) using the DataFormatString tag, you will also need to set the
HtmlEncode tag to false or it won't work...
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:us**************@TK2MSFTNGP02.phx.gbl...
Can someone help me format this so it's in H:mm format?
Dim CurTime As DateTime = DateTime.Now.ToString("H:mm")
TextBox1.Text = CurTime
When I try that, I get non military time like 3:31:00 PM.
Dim CurTime As DateTime = DateTime.Now.ToString("H:mm")
TextBox1.Text = CurTime
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:us**************@TK2MSFTNGP02.phx.gbl...
>Can someone help me format this so it's in H:mm format?
Dim CurTime As DateTime = DateTime.Now.ToString("H:mm")
TextBox1.Text = CurTime
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:uv**************@TK2MSFTNGP06.phx.gbl...
When I try that, I get non military time like 3:31:00 PM.
Hmm - OK, that's a little strange. That's definitely the correct way to do
it, though: http://msdn2.microsoft.com/en-us/lib...d4(VS.80).aspx
Anyone?
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:uv**************@TK2MSFTNGP06.phx.gbl...
When I try that, I get non military time like 3:31:00 PM.
Dim CurTime As DateTime = DateTime.Now.ToString("H:mm")
TextBox1.Text = CurTime
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
>"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message news:us**************@TK2MSFTNGP02.phx.gbl...
>>Can someone help me format this so it's in H:mm format?
Dim CurTime As DateTime = DateTime.Now.ToString("H:mm")
TextBox1.Text = CurTime This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Al |
last post by:
Hi
Is it a function to convert time to and from military time?
Thanks
|
by: richardkreidl |
last post by:
How would I check to see if the current time(military format) is
greater then 07:30AM and the day of the week is Monday-Friday.
Pseudo code:
If Current_Time > 07:30AM and Current_Day = Monday...
|
by: Scott |
last post by:
If I have a datetime sql field with afternoon datetime values like below in
DATETIME VALUE, how can I display the time part in ASP as 1:00 PM, instead
of 13:00 PM as seen in CURRENT RESULTS below?...
|
by: ApexData |
last post by:
Hello
Any know how to convert AM/PM Time to 24Hr Time ?
Sample Please ! With and without Now().
ThankYou
Greg
|
by: wocosc |
last post by:
I have a quick question.. How can get python to take whatever time of day it is, and output it as military time? I already know how to get it to return the specific time.
|
by: AccessIdiot |
last post by:
Argh! This is driving me crazy. My db users want to be able to enter a string of numbers for hours, minutes, seconds, in military time format (021256 for 2:12:56 a.m. and 152416 for 3:24:16 p.m.)....
|
by: okaymy1112 |
last post by:
I have data in this format 0800, 1730, 0930, etc.
I do not know how to convert this time to read something like, 8:00AM, 5:30 PM, 9:30AM etc.
Also I want to group things by day. I have courses...
|
by: drg |
last post by:
My assignment is actually encapsulation which is not the problem -- my
program needs to take two military times and calculate the minutes
elapsed between the two. I have everything worked out so...
|
by: mdthom08 |
last post by:
I can't figure out the formula to convert military time all to minutes.
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |