title: Get values to time span type using TimePicker and razor in ASP.NET MVC
body: <p>I have a model that contains attribute of type <code>TimeSpan</code>:</p>
  
  <pre><code>public TimeSpan Time { get; set; }
  </code></pre>
  
  <p>I want the user to enter values using a form to get the time span. I'm using timepicker lib and razor <code>@Html.EditorFor</code>.</p>
  
  <p>The problem is that the attribute <code>Time</code> always gets the default values. I searched for this problem and some people talked about changing the time format but I didn't know how to do it</p>
  
  <p>The html looks like this</p>
  
  <pre><code>  @Html.EditorFor(b =&gt; b.Time, new { htmlAttributes = new { @id = "time", @class = "form-control timepicker", @required = "" } })
  </code></pre>
  
  <p>when running the input looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/XKzQD.png" rel="nofollow noreferrer">html timepicker lib</a></p>
  
  <p>How can I use the timepicker and razor in a simple way to get values for time span?</p>