private static TimeSpan ToTimeSpan(string time) { if (string.IsNullOrWhiteSpace(time)) { return TimeSpan.Zero; } var components = time.Split(':'); return new TimeSpan(int.Parse(components[0]), int.Parse(components[1]), 0); }