Date ,Time with update [Resolved]

Posted by Raja_89 under C# on 6/7/2013 | Points: 10 | Views : 1583 | Status : [Member] | Replies : 5
Hai Techies
How can i display the time with updates [hh:mm::ss]
Ex: 09:10:01
After some time
09:10:02
..etc


Regards




Responses

Posted by: Bageshkumarbagi on: 6/7/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi Raja,

You Use Timer and set Interval is 1000 and display the value in label

private void timer1_Tick(object sender, EventArgs e)
{
labelTimer.Text = DateTime.Now.ToLongTimeString();
}

Thanks,
Bagesh Kumar Singh

Thanks,
Bagesh Kumar Singh
Mark as answer if you have been satisfied

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bageshkumarbagi on: 6/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Raju,

If my solutation is helpful to you than mark As answer.


Thanks,
Bagesh Kumar Singh

Thanks,
Bagesh Kumar Singh
Mark as answer if you have been satisfied

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 6/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
in page load event you will mention datetime .now .tostring ();
if you refresh the page means it will update automatically
Mark as answer if it helps you
Thanks& Regards
Aswini Aluri

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 6/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
in page load event you will mention datetime .now .tostring ();
if you refresh the page means it will update automatically
Mark as answer if it helps you
Thanks& Regards
Aswini Aluri

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 6/9/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello

You will have to use timer to achieve this .

Drag and drop Timer Control
Drag and drop a Label to display time

Double click on the timer control you will generate a TICK event and write this code

private void timer1_Tick(object sender, EventArgs e)
{
lbldt.Text = DateTime.Now.ToLongTimeString();
}

Set interval to 1000.

Note :- Do not forget to enable the timer .

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response