No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

IntlCalendar::isWeekend

(PHP 5 >= 5.5.0, PHP 7, PECL >= 3.0.0a1)

IntlCalendar::isWeekendWhether a certain date/time is in the weekend

Description

Object oriented style

public IntlCalendar::isWeekend ([ float $date = NULL ] ) : bool

Procedural style

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.

PHP: IntlCalendar::isWeekend - Manual Home of Manuel PHP  Contents Haut

Parameters

cal

The IntlCalendar resource.

date

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

PHP: IntlCalendar::isWeekend - Manual Home of Manuel PHP  Contents Haut

Return Values

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

The value FALSE 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.

PHP: IntlCalendar::isWeekend - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 IntlCalendar::isWeekend()

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

$cal = new IntlGregorianCalendar(NULL'en_US');
$cal->set(2013/* 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/* July */7); // a Sunday 
var_dump($cal->isWeekend()); // false, Sunday not in weekend in this calendar

PHP: IntlCalendar::isWeekend - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph