title: MVC Core - Get value from a static method into View
body: <p>I have edited my question to make it more clear:</p>
  
  <p>I have website with ads listing page, where multiple ads are listed by category. Currently along with other information the page displays the exact DateTime ad was submitted to website.</p>
  
  <p>Now, I also want to display the number of hours or days or weeks ad been on the website.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>Ad was posted 2 days ago 
  Ad was posted 1 week ago etc
  </code></pre>
  
  <p>Similar to what you see at the end of each comment posted on StackOverflow i.e:</p>
  
  <pre><code>– Stephen Muecke 5 hours ago
  – Jilani pasha 4 hours ago
  - Stephen Muecke 36 mins ago
  </code></pre>
  
  <p>I have already written a method that takes Ad posting DateTime and returns the hours or days or weeks. </p>
  
  <p>What I want to know is how to call and pass value (Ad posting date) to that method from my view?
  Or What is the best way to achieve this?</p>