title: asp.net mvc3 how do you format the datetime in the view
body: <p>I try to format the datetime in the view.</p>
  
  <pre><code>&lt;span class="tag"&gt;
          @Html.DisplayFor(modelItem =&gt; item.PostDate.ToString("yyyy"))  
  &lt;/span&gt;
  </code></pre>
  
  <p>here's the error message I got.</p>
  
  <p>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.</p>
  
  <p>how do i fix it?</p>