title: How to format user input into time
body: <p>I am writing a simple class in C# that all it does is print three float variables to a DOS console (hour, minutes, seconds). The output is something like this: Hour = 3, Minutes = 15, Seconds = 0. But I want to know how would I go about in formatting it to show 3:15:00 rather than Hour = 3, Minutes = 15, Seconds = 0</p>
  
  <p>This is the method I created that prints out the info:</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Prints the time to the console
  /// &lt;/summary&gt;
  public void PrintTime()
  {
      Console.WriteLine(pHour.ToString() + ":" + pMinutes.ToString() + ":" + Seconds.ToString());
  }
  </code></pre>
  
  <p>Can someone help me figure out how to format this? I went online and found out about DateTime but it requires the date as well and I don't need to add that for this homework. Many thanks in advance!</p>