SyntaxFix
Write A Post
Hire A Developer
Questions
For time:
label1.Text = DateTime.Now.ToString("HH:mm:ss"); //result 22:11:45
or
label1.Text = DateTime.Now.ToString("hh:mm:ss tt"); //result 11:11:45 PM
For date:
label1.Text = DateTime.Now.ToShortDateString(); //30.5.2012