Template:Time ago: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>Dispenser Trying to simplify template design |
meta>Happy-melon overhaul |
||
| Line 1: | Line 1: | ||
{{#switch: | {{#switch: <!--WHAT 'ORDER OF MAGNITUDE' IS THE OFFSET?--> | ||
{{#ifexpr: abs({{#time:U}}-{{#time:U|{{{1|}}}}}) | {{#ifexpr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 60 round 0 | 1 | 0 }}+ | ||
{{#ifexpr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 3600 round 0 | 1 | 0 }}+ | |||
{{#ifexpr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 86400 round 0 | 1 | 0 }}+ | |||
}} | {{#ifexpr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 2678400 round 0 | 1 | 0 }}+ | ||
|0 | |||
|1 | | 0 <!--LESS THAN A MINUTE--> = {{#expr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) }} seconds | ||
| 1 <!--LESS THAN AN HOUR--> = {{#expr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) }} minutes | |||
| 2 <!--LESS THAN A DAY--> = {{#expr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) }} hours | |||
| 3 <!--LESS THAN A MONTH--> = {{#expr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) }} days | |||
| | | 4 <!--OVER A MONTH--> = {{#expr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) }} months | ||
| | |||
}}{{#ifexpr: abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) |  ago | ' time }}<noinclude> | |||
| | |||
| | |||
| | |||
| | |||
}}<noinclude> | |||
{{documentation|content= | {{documentation|content= | ||
{{tl|{{PAGENAME}}}} calculates dates and times since an event has passed. | {{tl|{{PAGENAME}}}} calculates dates and times since an event has passed. | ||
Revision as of 17:36, 19 April 2009
' time
{{Time ago}} calculates dates and times since an event has passed.
Examples
- {{Time ago|Sat, 06 Dec 2025 12:15:20 +0000}}
→ ago - {{Time ago|Sat, 06 Dec 2025 10:15:20 +0000}}
→ ago - {{Time ago|-500 minutes}}
→ ago - {{Time ago|Jan 21, 2001 3:45 PM}}
→ ago - {{Time ago|Oct 18 2008}}
→ ago - {{Time ago|Nov 7 2008 3:45 PM}}
→ ago