insert time
-
Hi, did you tried this: DateTime.Now.ToString("HH:mm:ss") ? Regards Sebastian P.S.: Please don't shout next time...
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
yes i tired this bt it show 12 hour after 12 am show 1 pm bt i want 13:00.
-
yes i tired this bt it show 12 hour after 12 am show 1 pm bt i want 13:00.
Okay, now I need more information. What are you doing exactly? Could you post a bit of your code?
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
Okay, now I need more information. What are you doing exactly? Could you post a bit of your code?
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
this is my coding InitializeComponent(); { timer.Tick += new EventHandler(timer1_Tick); timer.Interval = (1000) * (1); timer.Enabled = true; timer.Start(); } private void timer1_Tick(object sender, EventArgs e) { DateTime dt = DateTime.Now; Time.Text = dt.ToString("hh:mm:ss"); }
-
this is my coding InitializeComponent(); { timer.Tick += new EventHandler(timer1_Tick); timer.Interval = (1000) * (1); timer.Enabled = true; timer.Start(); } private void timer1_Tick(object sender, EventArgs e) { DateTime dt = DateTime.Now; Time.Text = dt.ToString("hh:mm:ss"); }
As said before: You have to use ToString("HH:mm:ss"). The format-string is case-sensitive. Uppercase H means 24-hour format.
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
As said before: You have to use ToString("HH:mm:ss"). The format-string is case-sensitive. Uppercase H means 24-hour format.
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
thanks alot sir.
-
yes i tired this bt it show 12 hour after 12 am show 1 pm bt i want 13:00.
No way!!!! it is working and it should work!!! I am using the same format for several years now!!! no problem yet!!
Have a Happy Coding.....
-
No way!!!! it is working and it should work!!! I am using the same format for several years now!!! no problem yet!!
Have a Happy Coding.....
-
My reply was for the message posted by SeMartens. it clearly says "HH:mm:ss" ofcourse there are several ways that it can produce wrong results if you supply wrong formats like hh:mm:ss... HH:MM:ss ---------> which will give hours-months-seconds instead of minutes HH:mm:ss tt ------> which will give 24 hours-minutes-seconds Am/Pm hh:mm:SS ---------> will give hours-minutes-string "SS" and so on......
Have a Happy Coding.....
-
My reply was for the message posted by SeMartens. it clearly says "HH:mm:ss" ofcourse there are several ways that it can produce wrong results if you supply wrong formats like hh:mm:ss... HH:MM:ss ---------> which will give hours-months-seconds instead of minutes HH:mm:ss tt ------> which will give 24 hours-minutes-seconds Am/Pm hh:mm:SS ---------> will give hours-minutes-string "SS" and so on......
Have a Happy Coding.....
-
Hi. i want 2 show time 24 hour how i can??
That is all available in the documentation. Don't be lazy. :^)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Hi. i want 2 show time 24 hour how i can??
Using String.Format with "HH" - The hour, using a 24-hour clock from 00 to 23. More formats & examples here.
Who are you and why should I care?