الگو:Time ago/core

From بنیاد دانش آزاد
Jump to: navigation, search

{{#expr:floor(abs({{#time:U}}-{{#time:U|}})/{{#switch:{{#ifexpr:-1>{{{auto_magnitude_num}}}

 |{{{min_magnitude_num}}}
 |0
}}
|0 = 1
|1 = 60
|2 = 3600
|3 = 86400
|4 = 604800
|5 = 2678400
|6 = 31557600
|#default=1

}})}} {{#switch:{{#ifexpr:-1>0

 |{{{min_magnitude_num}}}
 |0
}}
|0 = ثانیه
|1 = دقیقه
|2 = ساعت
|3 = روز
|4 = هفته
|5 = ماه
|6 = سال

}}