private DateTime timeStart = DateTime.Now;
private void WorkTime_Tick(object sender, EventArgs e)
{
WorkTimeLabel.Content = "Рабочее время: " + ((DateTime.Now - timeStart).ToString("hh:mm"));
}
System.FormatException: 'Входная строка имела неверный формат.'
WorkTimeLabel.Content = $"Рабочее время: {DateTime.Now.Subtract(timeStart).ToString(@"hh\:mm")}";
WorkTimeLabel.Content = "Рабочее время: " +
(DateTime.Now - timeStart).ToString(@"d\д\ hh\:mm").TrimStart('0', 'д').Trim();
DateTime start = DateTime.Now;
TimeSpan timeDiff = DateTime.Now - start;
timeDiff.Hours;
timeDiff.Minutes;