title: How to display a TimeSpan in MVC Razor
body: <p>So I have a duration in seconds of a video and I would like to display that duration in Razor. </p>
  
  <p>Currently I am using </p>
  
  <pre><code>@TimeSpan.FromSeconds(item.Duration).ToString()
  </code></pre>
  
  <p>However the rest of the code I am using uses </p>
  
  <pre><code>@Html.DisplayFor(modelItem =&gt; item.Description)
  </code></pre>
  
  <p>Is there way to get the duration (currently an int) to display a as a timespan? using the <code>@Html.DisplayFor</code> syntax. The item.duration is pulling form a Entity Framework model which is held as a int in the database. </p>