Documentation

add

\Bitrix\Main\Type\Date public
\Bitrix\Main\Type\Date::add(
 string $interval
);

Non-static method executes arithmetics actions with dates.

Period duration is represented by a numerical value, following after period indicator. When duration includes time elements, then this portion is preceded by letter "T".

Method formats are similar to the date and intervals formats in PHP.

Examples: two days - 2D, two seconds - T2S, 6 years and 5 minutes - 6YT5M.

Types of blocks must be printed from left to right from large values to smaller ones. Use "-". as the first symbol for both negative and relative periods.

Examples:: "+5 weeks", "12 day", "-7 weekdays", '3 months - 5 days'

Parameters

ParameterDescriptionVersion
$intervalTime interval to be added.

Example



© «Bitrix24», 2001-2024
Up