Difference between revisions of "Template:Years ago"
Jump to navigation
Jump to search
(New page: {{#expr: {{{1}}} - {{CURRENTYEAR}} }}<noinclude> Examples: * <nowiki>{{years ago|1980}}</nowiki> = {{years ago|1980}} (years since Reagan was elected) </noinclude>) |
m (Protected "Template:Years ago" [edit=sysop:move=sysop]) |
||
| (7 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | {{#expr: {{{1}}} - {{ | + | <includeonly>{{#expr: {{CURRENTYEAR}} - {{{1}}} }}</includeonly><noinclude> |
| + | |||
| + | ==Code== | ||
| + | |||
| + | Subtract the argument from the current year: | ||
| + | |||
| + | <nowiki>{{#expr: {{CURRENTYEAR}} - {{{1}}} }}</nowiki> | ||
| + | |||
| + | ==Examples== | ||
| − | |||
* <nowiki>{{years ago|1980}}</nowiki> = {{years ago|1980}} (years since Reagan was elected) | * <nowiki>{{years ago|1980}}</nowiki> = {{years ago|1980}} (years since Reagan was elected) | ||
| + | |||
| + | |||
| + | {|border=1 cellpadding=3 | ||
| + | |+ Various historical events | ||
| + | |- | ||
| + | !Year || Event || Years ago | ||
| + | |- | ||
| + | |1602 | ||
| + | |Shakespeare wrote ''[[Hamlet]]'' | ||
| + | |{{years ago|1601}} | ||
| + | |- | ||
| + | |1945 || US and allies won [[WWII]] || {{years ago |1945}} | ||
| + | |} | ||
</noinclude> | </noinclude> | ||