FANDOM


0 seconds ago

Documentation icon Mallineen dokumentointi[Katso] [muokkaa] [päivitä]

Tämä dokumentaatio tulee sivulta Malline:Time ago/doc.

The Time ago template calculates the amount of time which has passed since a provided timestamp. The result is a string similar to one of the examples below. This template should not be used with "subst" unless you do not want the stamp to change as the user refreshes the page. The result is rounded down. "Month" is defined as 31 days.

Note that due to the wiki's caching mechanisms, you may need to purge a page using this template to update the dynamic value. See the purge parameter below.

Syntax

  • {{Time ago|timestamp|<magnitude>|<min_magnitude>|<ago>|<purge>}}

Parameters

  • timestamp parameter can be almost any solid, readable format but to avoid ambiguity mistakes, one of the styles below is preferred.
  • magnitude parameter can be set to explicitly use certain unit. Allowed values are: seconds, minutes, hours, days, weeks, months and years.
  • min_magnitude parameter can be set to use the specified unit or bigger units. Allowed values are: seconds, minutes, hours, days, weeks, months and years.
  • ago parameter can be set to override the default usage of the text "ago".
  • |purge=yes can be used to add a purge link.

Examples

  • {{Time ago|-83 minutes}} → 83 minutes ago
  • {{Time ago|-334 minutes}} → 5 hours ago
  • {{Time ago|{{REVISIONTIMESTAMP}}}} → 5 years ago
  • {{Time ago|Jan 21, 2001 3:45 PM}} → 19 years ago
  • {{Time ago|03:08, September 26, 2013 (UTC)}} → 6 years ago
  • {{Time ago|6 November 2011}} → 11 years ago
  • {{Time ago|6 November 2015}} → 4 years ago
  • {{Time ago|6 November 2011|magnitude=weeks}} → 452 weeks ago
  • {{Time ago|6 November 2011|min_magnitude=days}} → 8 years ago
  • {{Time ago|6 November 2011|min_magnitude=years}} → 8 years ago
  • {{Time ago|6 November 2011|ago=in the past}} → 8 years in the past
  • {{Time ago|23 September 2013|purge=yes}} → 6 years ago (update)
Community content is available under CC-BY-SA unless otherwise noted.