Java Calendar isLenient() 方法

2024年11月3日 | 阅读 1 分钟

Calendar 类的 isLenient() 方法在日历的解释模式宽松时返回布尔值 true;否则返回 false。

语法

参数

不传递任何参数。

返回值

返回布尔值。

抛出

不抛出异常。

示例 1

输出

Current Date and Time is Mon Aug 13 21:24:01 PDT 2018
Interpretation is lenient: true
NOW Date and Time is Mon Nov 11 21:24:01 PST 1996
Interpretation is lenient: true

示例 2

输出

Date and Time is Mon Aug 13 21:41:24 PDT 2018
 Is lenient: true