• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Compare dates/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Compare dates
This is the template sandbox page for Template:Compare dates (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]

Contents

  • 1 Usage
  • 2 Examples
  • 3 Parameters
  • 4 See also

Usage

edit

This template takes two mandatory unnamed parameters. The first is a date/time string and the second is a level of precision. It then returns a plain language comparison of the date/time to the current UTC date/time. If it's not the next, current, or previous one, the template just returns the date/time entered.

Examples

edit

Purge to update.

  • {{Compare dates|15:28 29 August 2025|hour}} returns this hour
  • {{Compare dates|29 August 2025|day}} returns today
  • {{Compare dates|July 2025|month}} returns last month
  • {{Compare dates|December 2025|month}} returns December 2025
  • {{Compare dates|October 1887|month}} returns October 1887

Parameters

edit

Returns a plain language comparison of a date or time to the present

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Date1

The date or time being compared

Daterequired
Precision2

The level of precision at which the comparison is being made; handles the suggested values listed.

Suggested values
hour day month year
Unknownrequired

See also

edit
  • {{Is now}}
  • {{Age switch}}
The above documentation is transcluded from Template:Compare dates/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Compare_dates/sandbox&oldid=1043548820"
Last edited on 10 September 2021, at 17:19

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 10 September 2021, at 17:19 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop