//get current time int h = DateTime.Now.Hour; int m = DateTime.Now.Minute; int s = DateTime.Now.Second; //time string time = ""; //----------------hour--------------- if (h < 10) time += "0" + h.ToString(); else time += h.ToString(); //---------------minite------------- time += " : "; if (m < 10) time += "0" + m.ToString(); else time += m.ToString(); //---------------minite------------- time += " : "; if (s < 10) time += "0" + s.ToString(); else time += s.ToString(); label2.Text = time;