Difference between revisions of "Template:Time ago/core"

From LIMSWiki
Jump to navigationJump to search
(Created as needed.)
 
Line 1: Line 1:
{{#ifexpr:{{#time:U}}>={{#time:U|{{{time|}}}}}
{{#ifexpr:{{#time:U}}>={{#time:U|{{{time|}}}}}
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
  |0 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second|seconds}}
  |0={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second|seconds|nb=y}}
  |1 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute|minutes}}
  |1={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute|minutes|nb=y}}
  |2 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour|hours}}
  |2={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour|hours|nb=y}}
  |3 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day|days}}
  |3={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day|days|nb=y}}
  |4 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week|weeks}}
  |4={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week|weeks|nb=y}}
  |5 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month|months}}
  |5={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month|months|nb=y}}
  |6 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year|years}}
  |6={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year|years|nb=y}}
}} {{{ago|ago}}}
}} {{{ago|ago}}}
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
  |0 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second's|seconds'}}
  |0={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second's|seconds'|nb=y}}
  |1 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute's|minutes'}}
  |1={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute's|minutes'|nb=y}}
  |2 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour's|hours'}}
  |2={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour's|hours'|nb=y}}
  |3 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day's|days'}}
  |3={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day's|days'|nb=y}}
  |4 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week's|weeks'}}
  |4={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week's|weeks'|nb=y}}
  |5 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month's|months'}}
  |5={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month's|months'|nb=y}}
  |6 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year's|years'}}
  |6={{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year's|years'|nb=y}}
}} time
}} time
}}
}}

Revision as of 21:52, 4 February 2020

0 seconds ago