文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

This template returns the number of full years and surplus days between two specified dates. If only one date is entered, the template returns the number of full years and surplus days between the specified date and today's date.

This template does not generate a sort key. In a Help:可排序表格, use ((ayd)) which redirects to ((age in years and days nts)).

用法

Each date can be entered in a single parameter, or each date can be entered as three parameters: year, month, day.

An error is shown if an entered date is not valid (1800, 1900 and 2100 were not a leap year).

設定顯示格式

可通過參數age來更改顯示格式:

选项

The default is to separate years and days with a comma. The separator is "and" if |sep=and is used.

The default calculates an age—the day of the second date is not included in the calculation. A duration including the second date is calculated if |duration=on is used.