title: how to add hours and min in the text box in view to filter data
body: <p>i have two text boxes for from date and to date , i want to add two more text boxes for hrs:min, how to add two more text boxes and pass the values into my controlller so that i can filter the records according to the date as well as time.</p>
  
  <p>view</p>
  
  <pre><code> &lt;span style="float:left; padding:10px;"&gt;Ftom Date : &lt;/span&gt;&lt;input type="text" name="fromDate" value="@(ViewBag.FromDate != null ? Convert.ToDateTime(ViewBag.FromDate).ToString("dd/MM/yyyy") : "")" class="form-control datetime" id="txtFromDate" style="float:left; width:100px;" /&gt;
                  &lt;span style="float:left; padding:10px;"&gt;HRS : &lt;/span&gt;&lt;input type="text" name="FromHrs" value="" class="form-control datetime" id="txtFromDate" style="float:left; width:50px;" placeholder="Hrs" /&gt;&lt;input type="text" name="FromMin" value="" class="form-control datetime" id="txtFromDate" style="float:left; width:50px;" placeholder="Min" /&gt;
  
                  &lt;span style="float:left; padding:10px;"&gt;To Date : &lt;/span&gt;&lt;input type="text" name="toDate" value="@(ViewBag.ToDate != null ? Convert.ToDateTime(ViewBag.ToDate).ToString("dd/MM/yyyy") : "")" class="form-control datetime" id="txtToDate" style="float:left; width:100px;" /&gt;
                  &lt;span style="float:left; padding:10px;"&gt;HRS : &lt;/span&gt;&lt;input type="text" name="ToHrs" value="" class="form-control datetime" id="txtFromDate" style="float:left; width:50px;" placeholder="Hrs" /&gt;&lt;input type="text" name="ToMin" value="" class="form-control datetime" id="txtFromDate" style="float:left; width:50px;" placeholder="Mins" /&gt;
                  &lt;span style="float:left; padding:10px;"&gt;Device : &lt;/span&gt;
                  @using (Html.BeginForm("Index", "SignalTesting", FormMethod.Post, new { enctype = "multipart/form-data", id = "form" }))
                  {
                      &lt;div&gt;
                          &lt;span &gt;Ftom Date : &lt;/span&gt;&lt;input type="text" name="fromDate" value="@(ViewBag.FromDate != null ? Convert.ToDateTime(ViewBag.FromDate).ToString("dd/MM/yyyy") : "")" class="form-control datetime" id="txtFromDate"  /&gt;
                      &lt;span&gt;To Date : &lt;/span&gt;&lt;input type="text" name="toDate" value="@(ViewBag.ToDate != null ? Convert.ToDateTime(ViewBag.ToDate).ToString("dd/MM/yyyy") : "")" class="form-control datetime" id="txtToDate"  /&gt;
                          &lt;span &gt;Device : &lt;/span&gt;
                          &lt;select id="ddlDevices" name="DeviceID" class="form-control" &gt;
  
                              ...
                           &lt;/select&gt;
                          &lt;input type="submit" value="Submit" class="btn btn-default"  /&gt;
                      &lt;/div&gt;
                  }
               &lt;/div&gt;
          controller
         private AssetTracker getAssetDetails(string deviceID,int FHrs,int ToHrs,int FromMin,int ToMin, DateTime? fromDate = null, DateTime? toDate = null)
  
                  {
  
                  int Fromhours = FHrs;
                  int Tohours = ToHrs;
                  int From_min = FromMin;
                  int To_min = ToMin;
  
             var items = Pirs.Where(a =&gt; !a.dataFrame.EndsWith("AAAAAAAAAAA=") &amp;&amp; (fromDate == null || fromDate.Value.Date &lt;= TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Date) &amp;&amp; (toDate == null || toDate.Value.Date &gt;= TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Date) &amp;&amp; TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Hour &gt;= Fromhours &amp;&amp; TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Hour &lt;= Tohours
                          &amp;&amp; TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Minute &gt;= From_min &amp;&amp; TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(a.timestamp), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")).Minute &lt;= To_min) 
          }
  </code></pre>