title: How do I get the hour part with SqlFunctions.DateName
body: <p>I have a query where I need to compare 24hour format Hour of a datetime property in an entity with a 24hour time string</p>
  
  <p>example:</p>
  
  <pre><code>var time = "14:00";
  var results = db.Table.Where(item =&gt; 
      SqlFunctions.DateName("HH:mm", item.DateTimeProperty) == time);
  </code></pre>
  
  <p>Although this throws the following </p>
  
  <p>{"'HH:mm' is not a valid value for the DATEPART argument in the 'SqlServer.DATENAME' function."}</p>
  
  <p>How can I convert a datetime property to 24hour-clock time with SqlFunctions?</p>