แม่แบบ:YEAR
| มีการใช้แม่แบบนี้ในหลายพันหน้าและการแก้ไขอาจทำให้เกิดผลกระทบหรือสังเกตเห็นได้ ควรทดสอบการเปลี่ยนแปลงในกระบะทราย หรือหน้าทดสอบ หรือในหน้าย่อยผู้ใช้ของคุณเอง อนึ่ง อภิปรายเกี่ยวกับการแก้ไขแม่แบบได้ที่หน้าอภิปรายก่อนที่จะนำไปใช้ |
Usage
[แก้]{{YEAR|string formatted as a valid date}}
Specify optional parameter {{{2}}} to get soft error rather than a hard {{error}}
{{1999}}
{{1999-12-12}}
{{January 1999}}
{{1 January 1999}}
{{January 1, 1999}}
{{1-2-1990}}
{{1/2/1990}}
{{2239-10-23}}
Reports "Error" if given bad input:
{{1-14-1990}}
Reason for the error: there are not 14 months.
{{61 January 1999}}
Reason for the error: no month has 61 days.
{{1 MyMonth 1999}}
Reason for the error: there is no such month name.
{{some text which is not a date}}
Reason for the error: no date information to parse.
{{on approximately 1999-12-12}}
Reason for the error: includes extraneous content.
If used with a year range, it returns only the first match:
{{1999-2001}}
This presently only works when the year range is specified with a hyphen; if correctly given with an en dash, it reports an error (this will probably not be fixed, because handling ranges is not the template's function; that it kinda-sorta works on something like 1999-2001 with a hyphen is basically just an accident):
{{1999–2001}}
If used without input, it simply outputs the current year:
{{[[แม่แบบ:|]]}}
It can be cleanly substituted for this purpose. If fed invalid data when substituted, it produces a larger, red error.
See also
[แก้]{{date}}– outputs the current date in various parameter-controlled formats{{DATE}}– a subst-only convenience template used inside cleanup/dispute templates;{{subst:DATE}}produces: date=สิงหาคม 2026- Category:Time, date and calendar templates – numerous date computing, formatting, annotating, and navigation templates