This is the
template sandbox page for
Template:Compare dates (
diff). See also the companion subpage for test cases. |
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.
{{
Compare dates|12:11 15 May 2024|hour}}
returns this hour
{{
Compare dates|15 May 2024|day}}
returns today
{{
Compare dates|April 2024|month}}
returns last month
{{
Compare dates|September 2024|month}}
returns September 2024
{{
Compare dates|October 1887|month}}
returns October 1887
Returns a plain language comparison of a date or time to the present
Parameter | Description | Type | Status | |
---|---|---|---|---|
Date | 1 | The date or time being compared | Date | required |
Precision | 2 | The level of precision at which the comparison is being made; handles the suggested values listed.
| Unknown | required |
This is the
template sandbox page for
Template:Compare dates (
diff). See also the companion subpage for test cases. |
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.
{{
Compare dates|12:11 15 May 2024|hour}}
returns this hour
{{
Compare dates|15 May 2024|day}}
returns today
{{
Compare dates|April 2024|month}}
returns last month
{{
Compare dates|September 2024|month}}
returns September 2024
{{
Compare dates|October 1887|month}}
returns October 1887
Returns a plain language comparison of a date or time to the present
Parameter | Description | Type | Status | |
---|---|---|---|---|
Date | 1 | The date or time being compared | Date | required |
Precision | 2 | The level of precision at which the comparison is being made; handles the suggested values listed.
| Unknown | required |