Assets.Scripts.Extensions.TimeSpanExtensions.FormatToSimpleSeconds C# (CSharp) Method

FormatToSimpleSeconds() public static method

public static FormatToSimpleSeconds ( this timeSpan ) : String
timeSpan this
return String
        public static String FormatToSimpleSeconds(this TimeSpan timeSpan)
        {
            int minutes = (int)Math.Floor(Math.Abs(timeSpan.TotalSeconds) % 3600 / 60);
            int seconds = (int)Math.Floor(Math.Abs(timeSpan.TotalSeconds) % 3600 % 60);
            return String.Format("{0}:{1:D2}", minutes, seconds);
        }
    }
TimeSpanExtensions