title: ASP.Net MVC Razor View - Find Age with Date of Birth
body: <p>I have a View that displays the Customer Details.</p>
  
  <p>I would like to display age by the Date of Birth available.</p>
  
  <p>I tried some thing like this.</p>
  
  <pre><code>@Html.DisplayTextFor(model =&gt; DateTime.Now.Date.Subtract(model.DOB))
  </code></pre>
  
  <p>where <strong>model.DOB</strong> has a value like <strong>7/23/1985 12:00:00 AM</strong></p>
  
  <p>That gives me an error</p>
  
  <blockquote>
    <p>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.</p>
  </blockquote>
  
  <p>Can you please help me how i can display age with the Date of Birth i have.</p>