Template:Date difference human friendly: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 1: Line 1:
{{#ifeq: {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} | 0 | today |
<includeonly>{{#ifeq: {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} | 0 | today |
   {{#ifeq: {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} | 1 | yesterday |
   {{#ifeq: {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} | 1 | yesterday |
     {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} days ago
     {{date difference|{{{1}}}|{{{2}}}|{{{3}}}}} days ago
   }}
   }}
}}<noinclude>[[Category:Utility templates]]</noinclude>
}}</includeonly><noinclude>
== Usage ==
<code><nowiki>{{date difference human friendly|year|month|day}}</nowiki></code>
 
== Examples ==
* <code><nowiki>{{date difference human friendly|</nowiki>{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}</code> returns '''{{date difference human friendly|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}'''
* <code><nowiki>{{date difference human friendly|</nowiki>{{#time:Y|now - 1 day}}|{{#time:m|now - 1 day}}|{{#time:d|now - 1 day}}}}</code> returns '''{{date difference human friendly|{{#time:Y|now - 1 day}}|{{#time:m|now - 1 day}}|{{#time:d|now - 1 day}}}}'''
* <code><nowiki>{{date difference human friendly|</nowiki>{{#time:Y|now - 2 day}}|{{#time:m|now - 2 day}}|{{#time:d|now - 2 day}}}}</code> returns '''{{date difference human friendly|{{#time:Y|now - 2 day}}|{{#time:m|now - 2 day}}|{{#time:d|now - 2 day}}}}'''
 
[[Category:Utility templates]]</noinclude>

Latest revision as of 12:19, 24 August 2021

Usage

{{date difference human friendly|year|month|day}}

Examples

  • {{date difference human friendly|2024|11|25}} returns today
  • {{date difference human friendly|2024|11|24}} returns yesterday
  • {{date difference human friendly|2024|11|23}} returns 2 days ago