|
|
| (27 intermediate revisions by 9 users not shown) |
| Line 1: |
Line 1: |
| {{#switch: | | {{#invoke:Time ago|main}}<noinclude> |
| {{#ifexpr: abs({{#time:U}}-{{#time:U|{{{1|}}}}}) < 180
| | {{documentation}} |
| | 0
| | <!-- Categories go in the /doc subpage and interwikis go in Wikidata. --> |
| | {{#expr: trunc( 1.4427 * ln( ({{#time:U}}-{{#time:U|{{{1}}}}})) - 7.3987) }}
| | </noinclude> |
| }}
| |
| |0 <!-- < 3 min --> = less than 3 minutes ago
| |
| |1 <!-- < 6 min --> | |
| |2 <!-- < 12 min --> = {{#expr: ({{#time:U}} - {{#time:U|{{{1|}}}}})/60 round 0 }} minutes ago
| |
| |3 <!-- < 23 min -->
| |
| |4 <!-- < 45 min -->
| |
| |5 <!-- < 90 min --> = {{#expr: ({{#time:U}} - {{#time:U|{{{1|}}}}})/12 round 0 * 5}} minutes ago
| |
| |6 <!-- < 3 hours -->
| |
| |7 <!-- < 6 hours --> = {{#expr: ({{#time:U}} - {{#time:U|{{{1|}}}}})/3600 round 1 }} hours ago
| |
| |8 <!-- < 12 hours-->
| |
| |9 <!-- < 1 day --> = {{#expr: ({{#time:U}} - {{#time:U|{{{1|}}}}})/3600 round 0 }} hours ago
| |
| |10<!-- < 2 days --> = Yesterday
| |
| |11<!-- < 4 days -->
| |
| |12<!-- < 8 days --> = {{#time:l|{{{1|}}}}}
| |
| |default= {{#expr: ({{#time:U}} - {{#time:U|{{{1|}}}}})/604800 round 0 }} weeks ago
| |
| }}<noinclude>
| |
| {{documentation|content=
| |
| {{tl|{{PAGENAME}}}} calculates dates and times since an event has passed.
| |
| | |
| == Examples ==
| |
| * {{Time ago|{{#time: r |-14 minutes}}}} <br/>→<span style="background:white;">{{Time ago|-14 minutes}}</span>
| |
| * {{Time ago|{{#time: r |-134 minutes}}}} <br/>→<span style="background:white;">{{Time ago|-123 minutes}}</span>
| |
| * <nowiki>{{Time ago|-500 minutes}}</nowiki><br/>→<span style="background:white;">{{Time ago|-500 minutes}}</span>
| |
| * <nowiki>{{Time ago|Jan 21, 2001 3:45 PM}}</nowiki><br/>→<span style="background:white;">{{Time ago|Jan 21 2001 3:45 PM}}</span>
| |
| * <nowiki>{{Time ago|Oct 18 2008}}</nowiki><br/>→<span style="background:white;">{{Time ago|Oct 18 2008 }}</span>
| |
| * <nowiki>{{Time ago|Nov 7 2008 3:45 PM}}</nowiki><br/>→<span style="background:white;">{{Time ago|Nov 7 2008 3:45 PM}}</span>
| |
| | |
| }}</noinclude>
| |
0 seconds ago
Lua error in package.lua at line 80: module 'Module:Documentation/config' not found.