API.WebClients.GoogleTransitClient.ToTimeSpan C# (CSharp) Method

ToTimeSpan() private static method

This gives a time span even if it's over 24 hours-- requires HH:MM or HH:MM:00 format.
private static ToTimeSpan ( string time ) : System.TimeSpan
time string
return System.TimeSpan
        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);
        }