模板:Birth year and age/doc查看源代码查看历史
本文档是Template:Birth year and age的文档子页面(见模板页自身)。 本页包含用法信息、分类和其他非原模板页面的内容。 |
用法
本模版{{Birth year and age}}和{{Death year and age}}显示一个人的出生或逝世年份与大概年龄。如果要完整显示出生或逝世年月日,请使用{{Birth date and age}}和{{Death date and age}}。
{{Birth year and age}}
假设:
- 某人的出生年份是1970年
- 今天是2025年3月20日
- 如果这个人是在1970年3月20日之后出生,那么他在今天(2025年3月20日)还没有过今年的生日,于是他就只是54岁。但是如果他是在1970年3月20日或之前出生,那么他就是55岁。
- 所以使用本模版
{{birth year and age|1970}}
时, - 他的出生年份与年龄是:1970年(54-55岁)
- 所以使用本模版
- 另外,如果我们知道这个人的出生月份,我们也可以使用本模版。
- 假设这个人出生的年月份是1970年6月,那么:
- 如果现在是2025年1月,即是说这个人今年还没有过生日。所以使用本模版
{{birth year and age|1970|6}}
时,他的出生年月份与年龄是:1970年6月(54岁)。 - 如果现在是2025年6月,我们并不知道他是否过了生日(因为我们不知道他哪一天出生)。所以本模版就会显示他的出生年份与年龄是:1970年6月(54-55岁)。
- 如果现在是2025年12月,即是说这个人今年已经过了生日。所以使用本模版时,他的出生年份与年龄是:1970年6月(55岁)。
- 如果现在是2025年1月,即是说这个人今年还没有过生日。所以使用本模版
- 假设这个人出生的年月份是1970年6月,那么:
{{Death year and age}}
假设:
- 某人的出生年份是1974年
- 他于2024年某日逝世
- 我们可以分开为两个例子:(1)某人出生于1974年12月31日,于2024年1月1日逝世,那么他还没有过在2024年12月31日的生日,于是他就只是49岁;(2)某人出生于1974年1月1日,于2024年12月31日逝世,那么他已经过了在2024年1月1日的生日,于是他就是50岁。
- 所以使用本模版
{{Death year and age|2024|1974}}
时, - 他的逝世年份与年龄是:2024年(49-50岁)
- 所以使用本模版
- 另外,如果我们知道这个人的逝世月份,我们也可以使用本模版。
- 使用上述例子,假设这个人的逝世月份是03(3月)
- 所以使用本模版
{{Death year and age|2024|1974|03}}
时, - 他的逝世年份与年龄是:2024年3月(49-50岁)
- 所以使用本模版
Note: Do not use this template inside the 求真百科:Persondata template as it can interfere with data extraction.
格式
{{Birth year and age|出生年份}} {{Birth year and age|出生年份|出生月份(可省略)}} {{Death year and age|逝世年份|出生年份}} {{Death year and age|逝世年份|出生年份|逝世月份(可省略)}}
范例
原始码 | 结果 |
---|---|
{{Birth year and age|1970}} | 1970年(54-55岁) |
{{Birth year and age|1970|03}} | 1970年3月(54-55岁) |
{{Death year and age|2024|1974}} | 2024年(49-50岁) |
{{Death year and age|2024|1974|03}} | 2024年3月(49-50岁) |
参见
- {{Birth date}}
- {{Death date}}
- {{Birth date and age}}
- {{Death date and age}}
- {{Age}}