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::isEquivalentTo

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

IntlCalendar::isEquivalentToWhether another calendar is equal but for a different time

Description

Object oriented style

public IntlCalendar::isEquivalentTo ( IntlCalendar $other ) : bool

Procedural style

intlcal_is_equivalent_to ( IntlCalendar $cal , IntlCalendar $other ) : bool

Returns whether this and the given object are equivalent for all purposes except as to the time they have set. The locales do not have to match, as long as no change in behavior results from such mismatch. This includes the timezone, whether the lenient mode is set, the repeated and skipped wall time settings, the days of the week when the weekend starts and ceases and the times where such transitions occur. It may also include other calendar specific settings, such as the Gregorian/Julian transition instant.

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

Parameters

cal

The IntlCalendar resource.

other

The other calendar against which the comparison is to be made.

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

Return Values

Assuming there are no argument errors, returns TRUE iif the calendars are equivalent except possibly for their set time.

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

Examples

Example #1 IntlCalendar::isEquivalentTo()

<?php
$cal1 
IntlCalendar::createInstance('Europe/Lisbon''pt_PT');
$cal2 IntlCalendar::createInstance('Europe/Lisbon''es_ES');
$cal2->clear();

var_dump($cal1->isEquivalentTo($cal2)); // true

$cal3 IntlCalendar::createInstance('Europe/Lisbon''en_US');
var_dump($cal1->isEquivalentTo($cal3)); // false
var_dump($cal1->getFirstDayOfWeek(),    // 2 (Monday)
$cal3->getFirstDayOfWeek());            // 1 (Sunday)

The above example will output:

bool(true)
bool(false)
int(2)
int(1)

PHP: IntlCalendar::isEquivalentTo - 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