Sam Kent

Sam Kent

  • NA
  • 4
  • 7.3k

Store value in a variable with time format

Aug 25 2015 1:36 AM
Hello every body, please could any one help me out there, i want to store value in a variable in a time format. for example if a user enter 3 on the console line the value should display like this  3:00:00. this is my code so far:
 
Console.Write("\n");
Console.Write(" {0,8}", "duration:\t");
length = Convert.ToString(Console.ReadLine(),@"d\.hh\:mm\:ss");
Console.Write("\n");
 
 but not working out. I appreciate any help from from any one. thanks

Answers (2)