Template:Monthyear-1
Appearance
May 2026
| This template is used on approximately 54,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
The {{Monthyear-1}} template takes no parameters and returns the name of the month and the year as they were a month ago, like this:
{{Monthyear-1}}renders: May 2026
Note that the same date can be shown for up to a week on a page since Wikipedia caches pages and only re-renders them under one of the follow circumstances:
- Someone visits the page and it has not been re-rendered in a week;
- Someone visits the page and manually purges or edits it.
See also
- {{Monthyear}} – renders this: June 2026
- {{Monthyear+1}} – renders this: July 2026
Don't do this yourself
The code for this template is not exactly trivial! {{#time:F Y|-1 month}} can fail near the end of some month:
{{#time:F Y|2000-03-29 -1 month}}→ February 2000{{#time:F Y|2001-03-29 -1 month}}→ March 2001{{#time:F Y|2026-05-31 -1 month}}→ May 2026{{#time:F Y|-1 month}}→ May 2026{{Monthyear-1}}→ May 2026
See here to learn more about time parser functions.