This is the template test cases page for the sandbox of Template:Years or months ago. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
The following examples use August 2024 as the current month and year. If that is not correct, click purge to update the page.
Live template vs. Sandbox
editYear and month
editParameters | Live template | Sandbox template | {{Start date and age}} | {{Time ago}} | {{Time ago}} min = months |
---|---|---|---|---|---|
Prior years | |||||
|2022|1
|
2 years ago | 2 years ago | January 2022 | 2 years ago | 2 years ago |
|2023|1
|
1 year ago | 1 year ago | January 2023 | 19 months ago | 19 months ago |
|2023|2
|
1 year ago | 1 year ago | February 2023 | 18 months ago | 18 months ago |
|2023|3
|
1 year ago | 1 year ago | March 2023 | 17 months ago | 17 months ago |
|2023|4
|
1 year ago | 1 year ago | April 2023 | 16 months ago | 16 months ago |
|2023|5
|
1 year ago | 1 year ago | May 2023 | 15 months ago | 15 months ago |
|2023|6
|
1 year ago | 1 year ago | June 2023 | 14 months ago | 14 months ago |
|2023|7
|
1 year ago | 1 year ago | July 2023 | 13 months ago | 13 months ago |
|2023|8
|
1 year ago | 1 year ago | August 2023 | 12 months ago | 12 months ago |
|2023|9
|
11 months ago | 11 months ago | September 2023 | 11 months ago | 11 months ago |
|2023|10
|
10 months ago | 10 months ago | October 2023 | 10 months ago | 10 months ago |
|2023|11
|
9 months ago | 9 months ago | November 2023 | 9 months ago | 9 months ago |
|2023|12
|
8 months ago | 8 months ago | December 2023 | 8 months ago | 8 months ago |
Current year | |||||
|2024|1
|
7 months ago | 7 months ago | January 2024 | 7 months ago | 7 months ago |
|2024|2
|
6 months ago | 6 months ago | February 2024 | 6 months ago | 6 months ago |
|2024|3
|
5 months ago | 5 months ago | March 2024 | 5 months ago | 5 months ago |
|2024|4
|
4 months ago | 4 months ago | April 2024 | 4 months ago | 4 months ago |
|2024|5
|
3 months ago | 3 months ago | May 2024 | 3 months ago | 3 months ago |
|2024|6
|
2 months ago | 2 months ago | June 2024 | 2 months ago | 2 months ago |
|2024|7
|
1 month ago | 1 month ago | July 2024 | 48 days ago | 1 month ago |
|2024|8
|
0 months ago | 0 months ago | August 2024 | 17 days ago | 0 months ago |
|2024|9
|
1 month's time | 1 month hence | September 2024 | 13 days' time | 0 months' time |
|2024|10
|
2 months' time | 2 months hence | October 2024 | 43 days' time | 1 month's time |
|2024|11
|
3 months' time | 3 months hence | November 2024 | 2 months' time | 2 months' time |
|2024|12
|
4 months' time | 4 months hence | December 2024 | 3 months' time | 3 months' time |
Future years | |||||
|2025|1
|
5 months' time | 5 months hence | January 2025 | 4 months' time | 4 months' time |
|2025|2
|
6 months' time | 6 months hence | February 2025 | 5 months' time | 5 months' time |
|2025|3
|
7 months' time | 7 months hence | March 2025 | 6 months' time | 6 months' time |
|2025|4
|
8 months' time | 8 months hence | April 2025 | 7 months' time | 7 months' time |
|2025|5
|
9 months' time | 9 months hence | May 2025 | 8 months' time | 8 months' time |
|2025|6
|
10 months' time | 10 months hence | June 2025 | 9 months' time | 9 months' time |
|2025|7
|
11 months' time | 11 months hence | July 2025 | 10 months' time | 10 months' time |
|2025|8
|
1 year's time | 1 year hence | August 2025 | 11 months' time | 11 months' time |
|2025|9
|
1 year's time | 1 year hence | September 2025 | 12 months' time | 12 months' time |
|2025|10
|
1 year's time | 1 year hence | October 2025 | 13 months' time | 13 months' time |
|2025|11
|
1 year's time | 1 year hence | November 2025 | 14 months' time | 14 months' time |
|2025|12
|
1 year's time | 1 year hence | December 2025 | 15 months' time | 15 months' time |
|2026|12
|
2 years' time | 2 years hence | December 2026 | 2 years' time | 2 years' time |
Year only (no month)
editParameters | Live template | Sandbox template | {{Start date and age}} | {{Time ago}} | {{Time ago}} min = years |
---|---|---|---|---|---|
|2022
|
2 years ago | 2 years ago | 2022 | 2 years ago | 2 years ago |
|2023
|
1 year ago | 1 year ago | 2023 | 12 months ago | 1 year ago |
|2024
|
0 years ago | 0 years ago | 2024 | 19 hours ago | 0 years ago |
|2025
|
1 year's time | 1 year hence | 2025 | 12 months' time | 1 year's time |
|2026
|
2 years' time | 2 years hence | 2026 | 24 months' time | 2 years' time |
Non-breaking space
editTest use of a non-breaking space between the number and the units (years, months, etc). A breaking space is used between the units and "ago" (similar to the output of Template:Time ago). These examples are placed inside a narrow <div> to force a line break.
Parameters | Live template | Sandbox template | {{Time ago}} |
---|---|---|---|
|2022
|
2 years ago
|
2 years ago
|
2 years ago
|
|2023
|
1 year ago
|
1 year ago
|
13 months ago
|
|2024|5
|
3 months ago
|
3 months ago
|
3 months ago
|
|2024|7
|
1 month ago
|
1 month ago
|
31 days ago
|
|2024|9
|
1 month's time
|
1 month hence
|
31 days' time
|
|2024|11
|
3 months' time
|
3 months hence
|
3 months' time
|
|2025
|
1 year's time
|
1 year hence
|
13 months' time
|
|2026
|
2 years' time
|
2 years hence
|
2 years' time
|
No parameters
editLive template | Sandbox template |
---|---|
0 years ago | 0 years ago |
Live template vs. Template:Time ago (with min_magnitude)
editYear and month
editTemplate | Output | {{Time ago}} template | {{Time ago}} output |
---|---|---|---|
{{Years or months ago|2022|8}}
|
2 years ago | {{Time ago|2022-8|min_magnitude=months}}
|
2 years ago |
{{Years or months ago|2023|8}}
|
1 year ago | {{Time ago|2023-8|min_magnitude=months}}
|
12 months ago |
{{Years or months ago|2024|5}}
|
3 months ago | {{Time ago|2024-5|min_magnitude=months}}
|
3 months ago |
{{Years or months ago|2024|6}}
|
2 months ago | {{Time ago|2024-6|min_magnitude=months}}
|
2 months ago |
{{Years or months ago|2024|7}}
|
1 month ago | {{Time ago|2024-7|min_magnitude=months}}
|
1 month ago |
{{Years or months ago|2024|8}}
|
0 months ago | {{Time ago|2024-8|min_magnitude=months}}
|
0 months ago |
{{Years or months ago|2024|9}}
|
1 month's time | {{Time ago|2024-9|min_magnitude=months}}
|
0 months' time |
{{Years or months ago|2024|10}}
|
2 months' time | {{Time ago|2024-10|min_magnitude=months}}
|
1 month's time |
{{Years or months ago|2025|8}}
|
1 year's time | {{Time ago|2025-8|min_magnitude=months}}
|
11 months' time |
{{Years or months ago|2026|8}}
|
2 years' time | {{Time ago|2026-8|min_magnitude=months}}
|
23 months' time |
Year only (no month)
editTemplate | Output | {{Time ago}} template | {{Time ago}} output |
---|---|---|---|
{{Years or months ago|2022}}
|
2 years ago | {{Time ago|2022|min_magnitude=years}}
|
2 years ago |
{{Years or months ago|2023}}
|
1 year ago | {{Time ago|2023|min_magnitude=years}}
|
1 year ago |
{{Years or months ago|2024}}
|
0 years ago | {{Time ago|2024|min_magnitude=years}}
|
0 years ago |
{{Years or months ago|2025}}
|
1 year's time | {{Time ago|2025|min_magnitude=years}}
|
1 year's time |
{{Years or months ago|2026}}
|
2 years' time | {{Time ago|2026|min_magnitude=years}}
|
2 years' time |