Template:TrDate
Jump to navigation
Jump to search
14 September 2024
This documentation is transcluded from Template:TrDate/doc.
Renders a text-form translation of a date into the page language
Usage
{{TrDate |1= }}
- Mainly intended to format a date in a translatable template in the Commons or Help namespaces.
- May be used to show the date provided, the current date, or a date xx years before the current date.
- By default, the result is in the page language rather than the user's preferred language.
- You may specify the user language as, e.g.
{{TrDate |1953-1-23 |lang={{int:lang}} }}
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
1 | Date in ISO format, e.g. 1995-12-25 | current date | optional | |
years | Number of years before current date. Omit the first parameter when using this. | empty | optional | |
lang | 2-digit language code, e.g. fr | Page language | optional |
Additional information
The template is intended to be used in the following namespaces: the Commons namespace
The template is intended to be used by the following user groups: no user group specified
Localization
This template is not intended to be localized.
Examples
Code | Renders | Notes |
---|---|---|
{{TrDate}} | 14 September 2024 | Default to current date |
{{TrDate|1953-11-1}} | 1 November 1953 | Date in page language |
{{TrDate|1953-11-1|lang=fr}} | 1er novembre 1953 | Date in French |
{{TrDate|years=50}} | 14 September 1974 | Date 50 years before current date |
{{TrDate|years=70|lang=th}} | 14 กันยายน พ.ศ. 2497 | Date 70 years ago in Thai calendar |