IntegerToTimeSpan

        /// <summary>
        /// Converts the seconds to a timespan object.
        /// </summary>
        /// <param name="totalSeconds">The total seconds.</param>
        /// <returns>A timespan object.</returns>
        public static TimeSpan IntegerToTimeSpan(this int totalSeconds)
        {
            return new TimeSpan(0, 0, totalSeconds);
        }
Example:
int seconds = 78654;

// Returns a TimeSpan object with 21 Hours, 50 Minutes and 54 Seconds
TimeSpan ts = seconds.IntegerToTimeSpan();

Description

Converts an integer to a timespan

Details

Double click on the code to select all.

 

;