Answers for "format float to time c#"

C#
2

format float to time c#

using System;

class Test
{
    static void Main()
    {
        float totalSeconds = 228.10803f;
        TimeSpan time = TimeSpan.FromSeconds(totalSeconds);
        Console.WriteLine(time.ToString("hh':'mm':'ss")); // 00:03:48
    }
}
Posted by: Guest on March-16-2020

C# Answers by Framework

Browse Popular Code Answers by Language