IntlCalendar::isWeekend() - IntlCalendar类
IntlCalendar::isWeekend()
(PHP 5 >= 5.5.0, PHP 7, PECL >= 3.0.0a1)
Whether a certain date/time is in the weekend
说明
面向对象风格publicIntlCalendar::isWeekend([float $date= NULL]): bool过程化风格
intlcal_is_weekend(IntlCalendar$cal[,float $date= NULL]): bool
Returns whether either the obejctʼs current time or the provided timestamp occur during a weekend in this objectʼs calendar system.
This function requires ICU 4.4 or later.
参数
$calThe IntlCalendar resource.
$dateAn optional timestamp representing the number of milliseconds since the epoch, excluding leap seconds. IfNULL
, this objectʼs current time is used instead.
返回值
A bool indicating whether the given or this objectʼs time occurs in a weekend.
The valueFALSE
may also be returned on failure, for instance after giving a date out of bounds on non-lenient mode; use exceptions or query intl_get_error_code() to disambiguate.
范例
IntlCalendar::isWeekend()