Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to create a dynamic digital clock ??
i use this kind of logic
C#
lbltime.text = datetime.now.tostring();


but it woudn't showing me time with changes in seconds & minutes

Thnx in Advance..
Posted
Updated 13-Feb-13 7:39am
v4
Comments
Richard C Bishop 13-Feb-13 11:44am    
That is not how things work here. You try your project and then if you get stuck, you post the code you have attempted and explain where you are stuck and provide error messages etc, etc. Use the "Improve question" widget to update your thread with the proper info.
joshrduncan2012 13-Feb-13 11:49am    
My 5.
Sergey Alexandrovich Kryukov 13-Feb-13 11:58am    
You should start with tagging application type or UI library your use. The question as is makes no sense at all.
—SA

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Feb-13 14:36pm    
Good, but ASP.NET or pure HTML/JavaScipt clock is missing, my 4. :-)
More seriously, I suggest not to answer until OP specifies the application time or UI library, platform, all required detail.
It's a waste of time to recommend solutions for a number of cases, just in case.
—SA
Maciej Los 13-Feb-13 14:45pm    
OK, i'll try to remember ;)
If you try this in case of windows form then it would be easier than what you think.Pick Timer control on your form.Then right click on it,you will find properties.At the event tag you will find tick event which you need to use.Then code just like as..
C#
private void timer1_Tick(object sender, EventArgs e)
{
    label1.Text = DateTime.Now.ToString("hh:mm:ss tt");
}

And see your clock is ready to operate!One thing need to mention here,you will find interval option in the properties of timer control where you can change interval of your clock.
Happy Coding..:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900