Documentation
README
Date and Time in Bitrix
Baseline: main 23.0+.
Bitrix does not use raw \DateTime — there are two wrappers that take into account site regional settings and user time zone.
Bitrix\Main\Type\Date— date only (time is always00:00:00).Bitrix\Main\Type\DateTime— date + time + time zone. Inherits fromDate.
Both inherit from PHP \DateTime, so ->format(...), ->getTimestamp(), etc., work.
use Bitrix\Main\Type\Date;
use Bitrix\Main\Type\DateTime;
$date = new Date('25.11.2025', 'd.m.Y');
$dt = new DateTime(); // now()
$dt = new DateTime('2025-11-25 14:30:00', 'Y-m-d H:i:s');
Formats: Bitrix Masks vs PHP
This is the opening of the README. Read the full README on GitHub.