Template:Time ago/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

This template invokes Module:TimeAgo.

It is not ready for use as long as the module miscalculates the duration!

Usage

{{Time ago|timestamp}} or {{Time ago|timestamp|option}}

Replace timestamp with a valid specification of date and/or time,

some are:

  • yyyy
  • yyyy-mm-dd
  • yyyy-mm-dd hh:mm
  • yyyy-mm-dd h:mm AM/PM
  • Mmm d yyyy h:mm AM/PM
  • {{REVISIONTIMESTAMP}}

Examples:

  • {{Time ago|2000}}24 years, 9 hours, 41 minutes and 30 seconds ago
  • {{Time ago|2000-01-01}}24 years, 4 days, 9 hours, 41 minutes and 30 seconds ago
  • {{Time ago|2000-01-01 13:00}}24 years, 3 days, 20 hours, 41 minutes and 31 seconds ago
  • {{Time ago|2000-01-01 1:00 PM}}24 years, 3 days, 20 hours, 41 minutes and 31 seconds ago
  • {{Time ago|Jan 1 2000 1:00 PM}}24 years, 3 days, 20 hours, 41 minutes and 31 seconds ago
  • {{Time ago|{{REVISIONTIMESTAMP}}}}1 year, 3 days, 8 hours, 51 minutes and 27 seconds ago

Options:

You can use optional parameters to shorten output:

  • |magnitude=years/months/days/hours/minutes
  • |min_magnitute=years/months/days/hours/minutes

Examples:

  • {{Time ago|2000|min_magnitude=years}}24 years ago
  • {{Time ago|2000-01-01|min_magnitude=days}}24 years and 4 days ago
  • {{Time ago|2000-01-01 13:00|magnitude=hours}}212488 hours ago

Parameters

Indicates the time that has elapsed since a specific date

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
timestamp1

date and time

Example
yyyy / yyyy-mm-dd / yyyy-mm-dd hh:mm / yyyy-mm-dd h:mm AM/PM / Mmm d yyyy h:mm AM/PM
Stringrequired
magnitudemagnitude

to set the scale (unit), the interval is shown

Example
days
Stringoptional
min_magnitudemin_magnitude

to shorten the display by removing the time units below the setting

Example
hours
Stringoptional