https://www.limswiki.org/index.php?title=Template:Time_ago/doc&feed=atom&action=historyTemplate:Time ago/doc - Revision history2024-03-29T08:50:59ZRevision history for this page on the wikiMediaWiki 1.36.1https://www.limswiki.org/index.php?title=Template:Time_ago/doc&diff=6694&oldid=prevShawndouglas: Created as necessary.2011-11-20T18:20:53Z<p>Created as necessary.</p>
<p><b>New page</b></p><div>{{Documentation subpage}}<br />
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --><br />
The '''Time ago''' template calculates the amount of time which has passed since a provided timestamp. The result is a string similar to one of the examples below. This template ''should not'' be used with "subst" unless you don't want the stamp to change as the user refreshes the page.<br />
<br />
Note that due to LIMSwiki's caching mechanisms, you may need to purge a page using this template to update the dynamic value.<br />
<br />
The result is rounded down. "Month" is defined as 31 days.<br />
<br />
=== Usage ===<br />
* <code><nowiki>{{</nowiki>'''Time ago'''|''timestamp''<nowiki>}}</nowiki></code><br />
<br />
The timestamp can be almost any solid, readable format but to avoid ambiguity mistakes, one of the styles below is preferred.<br />
<br />
* <code>magnitude</code> parameter can be set to explicitly use certain unit. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>weeks</code>, <code>months</code> and <code>years</code>.<br />
* <code>min_magnitude</code> parameter can be set to use the specified unit or bigger units. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>months</code> and <code>years</code>.<br />
* <code>ago</code> parameter can be set to override the default usage of the text "<code>ago</code>".<br />
<br />
=== Examples ===<br />
* <tt><nowiki>{{Time ago| -83 minutes}}</nowiki></tt> → '''{{Time ago|-83 minutes}}'''<br />
* <tt><nowiki>{{Time ago| -334 minutes}}</nowiki></tt> → '''{{Time ago|-334 minutes}}'''<br />
* <tt><nowiki>{{Time ago|{{REVISIONTIMESTAMP}}}}</nowiki></tt> → '''{{Time ago|{{REVISIONTIMESTAMP}}}}'''<br />
* <tt><nowiki>{{Time ago| Jan 21, 2001 3:45 PM}}</nowiki></tt> → '''{{Time ago|Jan 21 2001 3:45 PM}}'''<br />
* <tt><nowiki>{{Time ago| Nov 6 2008}}</nowiki></tt> → '''{{Time ago|Nov 6 2008}}'''<br />
* <tt><nowiki>{{Time ago| Nov 6 2008|magnitude=weeks}}</nowiki></tt> → '''{{Time ago| Nov 6 2008|magnitude=weeks}}'''<br />
* <tt><nowiki>{{Time ago| Nov 6 2008|min_magnitude=days}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|min_magnitude=days}}'''<br />
* <tt><nowiki>{{Time ago| Nov 6 2008|min_magnitude=years}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|min_magnitude=years}}'''<br />
* <tt><nowiki>{{Time ago| Nov 6 2008|ago=in the past}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|ago=in the past}}'''<br />
<br />
=== See also ===<br />
* {{tl|LastEditedBy}}<br />
<br />
<includeonly><br />
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --><br />
[[Category:Mathematical time and date function templates]]<br />
<br />
</includeonly></div>Shawndouglas