Template:Time interval/testcases

测试 1

{{Time interval|1 Jan 2001|March 4, 2002}}
  • {{Time interval|1 Jan 2001|March 4, 2002}} → 1年2个月又3天
  • {{Time interval/sandbox|1 Jan 2001|March 4, 2002}} → 1年2个月又3天
  • Expected: 1 year, 2 months and 3 days
{{Time interval|1 Jan 2001|March 4, 2002|abbr=on}}
  • {{Time interval|1 Jan 2001|March 4, 2002|abbr=on}} → 1y2m零3d
  • {{Time interval/sandbox|1 Jan 2001|March 4, 2002|abbr=on}} → 1y2m零3d
  • Expected: 1y 2m 3d
{{Time interval|B.C.E. 1 Feb 120|28 FEB 1900}}
  • {{Time interval|B.C.E. 1 Feb 120|28 FEB 1900}} → 2019年27天
  • {{Time interval/sandbox|B.C.E. 1 Feb 120|28 FEB 1900}} → 2019年27天
  • Expected: 2019 years and 27 days

测试 2

{{Time interval| 1958-06-07 | 2016-04-21}}
  • {{Time interval| 1958-06-07 | 2016-04-21}} → 57年10个月又14天
  • {{Time interval/sandbox| 1958-06-07 | 2016-04-21}} → 57年10个月又14天
  • Expected: 57 years, 10 months and 14 days
{{Time interval| 1961 | 1989 }}
  • {{Time interval| 1961 | 1989 }} → 28年
  • {{Time interval/sandbox| 1961 | 1989 }} → 28年
  • Expected: 28 years
{{Time interval| 1999-08-17 }}
  • {{Time interval| 1999-08-17 }} → 25年1个月又21天
  • {{Time interval/sandbox| 1999-08-17 }} → 25年1个月又21天
  • Expected: 22 years and 14 days (as of 2021)
{{Time interval| 17 August 1999 }}
  • {{Time interval| 17 August 1999 }} → 25年1个月又21天
  • {{Time interval/sandbox| 17 August 1999 }} → 25年1个月又21天
  • Expected: 22 years and 14 days (as of 2021)
{{Time interval| August 17, 1999 | disp=raw }}
  • {{Time interval| August 17, 1999 | disp=raw }} → 25 1 21
  • {{Time interval/sandbox| August 17, 1999 | disp=raw }} → 25 1 21
  • Expected: 22 14 (as of 2021)
{{Time interval| 1958-06-07 | 2016-04-21 | disp=age}}
  • {{Time interval| 1958-06-07 | 2016-04-21 | disp=age}} → 57年
  • {{Time interval/sandbox| 1958-06-07 | 2016-04-21 | disp=age}} → 57年
  • Expected: 57 years
{{Time interval| 1794-06-08 | 1795-03-16 }}
  • {{Time interval| 1794-06-08 | 1795-03-16 }} → 9个月8天
  • {{Time interval/sandbox| 1794-06-08 | 1795-03-16 }} → 9个月8天
  • Expected: 9 months 8 days
{{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31}}
  • {{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31}} → 1个月2天
  • {{Time interval/sandbox| 2016-04-08 20:43 | 2016-05-11 18:31}} → 1个月2天
  • Expected: 1 month and 2 days
{{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | abbr=on }}
  • {{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | abbr=on }} → 1m2d
  • {{Time interval/sandbox| 2016-04-08 20:43 | 2016-05-11 18:31 | abbr=on }} → 1m2d
  • Expected: 1m 2d
{{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | round=hours }}
  • {{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | round=hours }} → 1个月2天又22小时
  • {{Time interval/sandbox| 2016-04-08 20:43 | 2016-05-11 18:31 | round=hours }} → 1个月2天又22小时
  • Expected: 1 month, 2 days and 22 hours
{{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | round=days }}
  • {{Time interval| 2016-04-08 20:43 | 2016-05-11 18:31 | round=days }} → 1个月3天
  • {{Time interval/sandbox| 2016-04-08 20:43 | 2016-05-11 18:31 | round=days }} → 1个月3天
  • Expected: 1 month and 3 days
{{Time interval| 28 July 1914 | 11 November 1918 | round=weeks }}
  • {{Time interval| 28 July 1914 | 11 November 1918 | round=weeks }} → 4年3个月又2周
  • {{Time interval/sandbox| 28 July 1914 | 11 November 1918 | round=weeks }} → 4年3个月又2周
  • Expected: 4 years, 3 months and 2 weeks
{{Time interval| 13 June 2001 | 14 July 2002 | round=days }}
  • {{Time interval| 13 June 2001 | 14 July 2002 | round=days }} → 1年1个月又1天
  • {{Time interval/sandbox| 13 June 2001 | 14 July 2002 | round=days }} → 1年1个月又1天
  • Expected: 1 year, 1 month and 1 day