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