bitrix-datetime

Installation
SKILL.md

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 always 00:00:00).
  • Bitrix\Main\Type\DateTime — date + time + time zone. Inherits from Date.

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');
Installs
142
GitHub Stars
31
First Seen
Jul 16, 2026
bitrix-datetime — bxmaximum/bitrix-framework-skills