int ms = 123456; TimeSpan ts = TimeSpan.FromMilliseconds(ms); Console.WriteLine(ts.ToString(@"hh:mm:ss"));