CREATE AN CONSOLE APPLICATION
static void
Main(string[] args)
{
int iDuration;
Console.WriteLine("Enter
the seconds to convert and press enter");
iDuration = int.Parse(Console.ReadLine());
TimeSpan t = TimeSpan.FromSeconds(iDuration);
string sHours = string.Format("{0:D2}", t.Hours);
string sMinutes = string.Format("{0:D2}",
t.Minutes);
string sSeconds = string.Format("{0:D2}",
t.Seconds);
Console.WriteLine("\nHours:{0},Minutes:{1},Seconds:{2}",sHours,sMinutes,sSeconds);
Console.ReadKey();
}
OUTPUT
No comments:
Post a Comment