IntlCalendar::add
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
IntlCalendar::add
Референца за `intlcalendar.add.php` со подобрена типографија и навигација.
IntlCalendar::add
(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)
IntlCalendar::add — Add a (signed) amount of time to a field
= NULL
Напиши целосна ознака на елемент
Процедурален стил
Add a signed amount to a field. Adding a positive amount allows advances in time, even if the numeric value of the field decreases (e.g. when working with years in BC dates).
Other fields may need to adjusted – for instance, adding a month to the 31st of January will result in the 28th (or 29th) of February. Contrary to IntlCalendar::add(), when a value wraps around, more significant fields may change. For instance, adding a day to the 31st of January will result in the 1st of February, not the 1st of January.
Параметри
calendar-
Еден IntlCalendar instance.
field-
вистинска функција, само прототип за тоа како треба да биде функцијата. IntlCalendar date/time константи на поле. Овие се цели броеви помеѓу
0andIntlCalendar::FIELD_COUNT. value-
The signed amount to add to the current field. If the amount is positive, the instant will be moved forward; if it is negative, the instant will be moved into the past. The unit is implicit to the field type. For instance, hours for
IntlCalendar::FIELD_HOUR_OF_DAY.
Вратени вредности
Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.
Примери
Пример #1 IntlCalendar::get()
<?php
ini_set('intl.default_locale', 'fr_FR');
ini_set('date.timezone', 'UTC');
$cal = new IntlGregorianCalendar(2012, 0 /* January */, 31);
echo IntlDateFormatter::formatObject($cal), "\n";
$cal->add(IntlCalendar::FIELD_MONTH, 1);
echo IntlDateFormatter::formatObject($cal), "\n";
$cal->add(IntlCalendar::FIELD_DAY_OF_MONTH, 1);
echo IntlDateFormatter::formatObject($cal), "\n";Пример #1 Пример што покажува затворачка ознака што го опфаќа последниот нов ред
31 janv. 2012 00:00:00 29 févr. 2012 00:00:00 1 mars 2012 00:00:00