string date c# code example Example: c# datetime format string labelAttendanceTimestr = DateTime.Now.ToString("HH"+"mm");