IntlCalendar::isWeekend

Whether a certain date/time is in the weekend

&reftitle.description;

&style.oop;

public `bool` `IntlCalendar::isWeekend` ``float``null```timestamp`&null;

&style.procedural;

`bool` `intlcal_is_weekend` `IntlCalendar` `calendar` ``float``null```timestamp`&null;

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.

&reftitle.parameters;

`calendar`

- &intl.parameter.intl-calendar;

`timestamp`

- An optional timestamp representing the number of milliseconds since the epoch, excluding leap seconds. If &null;, this objectʼs current time is used instead.

&reftitle.returnvalues;

A `bool` indicating whether the given or this objectʼs time occurs in a weekend.

&intl.error.intl-calendar;
&reftitle.examples;

### `IntlCalendar::isWeekend`

    <?php
    ini_set('date.timezone', 'Europe/Lisbon');

    $cal = new IntlGregorianCalendar(NULL, 'en_US');
    $cal->set(2013, 6 /* July */, 7); // a Sunday

    var_dump($cal->isWeekend()); // true
    var_dump($cal->isWeekend(strtotime('2013-07-01 00:00:00'))); // false, Monday

    $cal = new IntlGregorianCalendar(NULL, 'ar_SA');
    $cal->set(2013, 6 /* July */, 7); // a Sunday
    var_dump($cal->isWeekend()); // false, Sunday not in weekend in this calendar

&reftitle.seealso;

- `IntlCalendar::getDayOfWeekType`
- `IntlCalendar::getWeekendTransition`