G glenn h Sep 15, 2005 #1 I have i time in Integer = 37825 , how can I convert it in C# to Timeformat = 10:30:25 Glenn
N Nicholas Paldino [.NET/C# MVP] Sep 15, 2005 #2 Glenn, Use the static FromSeconds method on the TimeSpan structure to convert the number of seconds to a TimeSpan. Hope this helps.
Glenn, Use the static FromSeconds method on the TimeSpan structure to convert the number of seconds to a TimeSpan. Hope this helps.
J Jon Skeet [C# MVP] Sep 15, 2005 #3 glenn h said: I have i time in Integer = 37825 , how can I convert it in C# to Timeformat = 10:30:25 Click to expand... I assume the integer is meant to be seconds since midnight? The easiest thing to do would be something like: DateTime time = Date.Today + new TimeSpan (0, 0, seconds);
glenn h said: I have i time in Integer = 37825 , how can I convert it in C# to Timeformat = 10:30:25 Click to expand... I assume the integer is meant to be seconds since midnight? The easiest thing to do would be something like: DateTime time = Date.Today + new TimeSpan (0, 0, seconds);
G glenn h Sep 15, 2005 #4 Thanks for a quick answer Nicholas! It works perfect. Regards Glenn Nicholas Paldino said: Glenn, Use the static FromSeconds method on the TimeSpan structure to convert the number of seconds to a TimeSpan. Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - (e-mail address removed) glenn h said: I have i time in Integer = 37825 , how can I convert it in C# to Timeformat = 10:30:25 Glenn Click to expand... Click to expand...
Thanks for a quick answer Nicholas! It works perfect. Regards Glenn Nicholas Paldino said: Glenn, Use the static FromSeconds method on the TimeSpan structure to convert the number of seconds to a TimeSpan. Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - (e-mail address removed) glenn h said: I have i time in Integer = 37825 , how can I convert it in C# to Timeformat = 10:30:25 Glenn Click to expand... Click to expand...