Answers.Body: <p>I have a plugin that adds the time_diff Twig filter to Craft:</p>
  
  <p><a href="https://github.com/mildlygeeky/craft-timediff" rel="nofollow">https://github.com/mildlygeeky/craft-timediff</a></p>
  
  <p>There is one possible issue (in either PHP or Craft) around DST, and I will add that to the README.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T14:08:42.647Z
Answers.Text: Unfortunately that ads a suffix "days ago" which is bad for a german Site :)
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T15:10:59.217Z
Answers.Text: Hi @KSPR - just added a new version that includes an array option with translated strings where possible, and you could then use the raw output to format the diff however you'd like. :)
Answers.UserDisplayName: Patrick Harrington
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-15T07:27:45.457Z
Answers.Text: Nice :) I'll check it out.
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T12:45:56.083Z
Answers.LastActivityDate: 2016-03-14T12:45:56.083Z
Answers.UserDisplayName: Patrick Harrington
Answers.Body: <p>You could use the <code>diff</code> method to get the number of days between two dates. So for example:</p>
  
  <pre><code>{{ date(entry.dateCreated|date('c')).diff(now).days }} days ago
  </code></pre>
  
  <p>In my example between today (using <code>now</code>) and the <code>entry.dateCreated</code>.</p>
  
  <p>There is a explanation as to why you need to wrap the first date in the <code>date</code> filter <a href="https://craftcms.stackexchange.com/a/9759/142">here</a>, which is where I got the answer from!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T14:07:35.677Z
Answers.Text: How would I print seconds or hours? `.seconds` does nothing?
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T14:18:40.950Z
Answers.Text: Instead of `.days`, use `.format`, and then use one of the format chars listed [here](http://php.net/manual/en/dateinterval.format.php). So for example to get months use `.format('%m')`.
Answers.UserDisplayName: Steve Holland
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T13:16:58.510Z
Answers.LastActivityDate: 2016-03-14T13:16:58.510Z
Answers.LastEditDate: 2017-04-13T12:51:00.303Z
Answers.UserDisplayName: Steve Holland
Body: <p>I'd like to reopen <a href="https://craftcms.stackexchange.com/questions/5365/how-to-replicate-x-days-posted-ago">this question</a>: </p>
  
  <p>The answer was a plugin called <a href="https://github.com/pvledoux/blocks-nicetime" rel="nofollow">Nice Time</a></p>
  
  <p>But This plugin is depricated and the creator stats that this functionality is acheivable via the <code>date_modify</code> filter.</p>
  
  <p>Yes okay, but how?</p>
  
  <p>I have a event archive where I want to show "This event happend <code>xy</code> days ago".</p>
  
  <p>There is a <a href="http://twig.sensiolabs.org/doc/extensions/date.html" rel="nofollow">time_diff</a> filter in twig. But it seems as if this is not activated in craft.</p>
  
Tags: <datetime>
Title: date_modify relative time
ThreadText: # date_modify relative time
  
  (Asked by: username_0 on 2016-03-14)
  
  I'd like to reopen [this question](https://craftcms.stackexchange.com/questions/5365/how-to-replicate-x-days-posted-ago):
  
  The answer was a plugin called [Nice Time](https://github.com/pvledoux/blocks-nicetime)
  
  But This plugin is depricated and the creator stats that this functionality is acheivable via the `date_modify` filter.
  
  Yes okay, but how?
  
  I have a event archive where I want to show "This event happend `xy` days ago".
  
  There is a [time\_diff](http://twig.sensiolabs.org/doc/extensions/date.html) filter in twig. But it seems as if this is not activated in craft.
  
  **Tags:** datetime
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2016-03-14. Score: 6 | Accepted answer
  
  You could use the `diff` method to get the number of days between two dates. So for example:
  
  ```
  {{ date(entry.dateCreated|date('c')).diff(now).days }} days ago
  
  ```
  
  In my example between today (using `now`) and the `entry.dateCreated`.
  
  There is a explanation as to why you need to wrap the first date in the `date` filter [here](https://craftcms.stackexchange.com/a/9759/142), which is where I got the answer from!
  
  > **Comments:**
  > **username_0**: How would I print seconds or hours? `.seconds` does nothing?  
  > **username_2**: Instead of `.days`, use `.format`, and then use one of the format chars listed [here](http://php.net/manual/en/dateinterval.format.php). So for example to get months use `.format('%m')`.  
  
  ---
  
  ### Answer by username_1 on 2016-03-14. Score: 3
  
  I have a plugin that adds the time\_diff Twig filter to Craft:
  
  <https://github.com/mildlygeeky/craft-timediff>
  
  There is one possible issue (in either PHP or Craft) around DST, and I will add that to the README.
  
  > **Comments:**
  > **username_0**: Unfortunately that ads a suffix "days ago" which is bad for a german Site :)  
  > **username_1**: Hi @username_0 - just added a new version that includes an array option with translated strings where possible, and you could then use the raw output to format the diff however you'd like. :)  
  > **username_0**: Nice :) I'll check it out.  
  
  ---
  
  