title: C# How to divide a number get the result in the format hh:mm:ss:<remainder>
body: <p>I want the value of division by the following format:</p>
  
  <p><code>hh:mm:ss:ff</code></p>
  
  <p>where <code>ff</code> is the reminder
  eg:</p>
  
  <p>63 divide by 25</p>
  
  <p><code>00:00:02:13</code></p>
  
  <p>How to achieve this?</p>
  
  <p>Actually <code>63</code> is the duration of a video played and <code>25</code> is the frames per second rate. I would like to know how long is the duration of the video in the above format?
  Currently I am using <code>string.format()</code>... methods to achieve this. </p>
  
  <p>Here is what I achieved but my question is to find a better way of doing this.</p>
  
  <pre><code>long x = 1513;
  long offset = x%25;
  long totalSeconds = (x-offset)/25;
  long hours = totalSeconds/(3600);
  long minutes = (totalSeconds%(3600))/(60);
  long seconds = totalSeconds%60;
  Console.WriteLine("hours=="+hours);
  Console.WriteLine("minutes=="+minutes);
  Console.WriteLine("Seconds=="+seconds);
  Console.WriteLine("Offset=="+offset);
  </code></pre>
  
  <p>Thanks</p>