bitrix-datetime

Normalize Bitrix date and time across server and user time zones.

33|3|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-datetime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bitrix-datetime
Source: https://github.com/bxmaximum/bitrix_ai_challenge/tree/main/.agents/skills/bitrix-datetime
Command: npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-datetime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bitrix applications often struggle with consistent date/time handling across server and user time zones, plus culture-aware formatting and correct persistence in ORM fields. This skill consolidates support for Bitrix\Main\Type\Date and Bitrix\Main\Type\DateTime, parsing and formatting using core masks, and converting between server time and user time. It enables reliable scheduling, time zone math, and correct storage of date-time values in DateField and DatetimeField.

Core Features & Use Cases

  • Parsing and formatting using Bitrix core masks for Date/DateTime and culture-aware representations.
  • Time zone handling with toUserTime/disableUserTime/enableUserTime to display and store times correctly.
  • ORM integration for DateField/DatetimeField with timestamp conversion and cross-time-zone calculations.

Quick Start

Parse a date string, convert to server time, and format it according to the site's culture.

Frequently Asked Questions about bitrix-datetime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Bitrix date and time values across different user time zones?

To handle Bitrix date and time values across time zones, use toUserTime, disableUserTime, and enableUserTime functions to accurately convert and display server times for individual users.

What is the best way to format Bitrix DateTime strings using site culture settings?

The best way to format Bitrix DateTime strings is by applying Culture::getDateFormat() and Culture::getDateTimeFormat() to ensure parsing and formatting align with the site's specific culture masks.

How do I parse and validate date strings in Bitrix ORM DateField and DatetimeField?

You can parse and validate date strings for Bitrix ORM DateField and DatetimeField by using DateTime::tryParse and Date::isCorrect, ensuring reliable timestamp conversion and cross-time-zone scheduling calculations.

Why do my Bitrix scheduling calculations show incorrect times for users in different time zones?

Incorrect scheduling times occur when timezone calculations bypass server time normalization. Proper timezone handling requires converting Bitrix DateTime values using toUserTime before display.

Does this approach support Bitrix Type Date and DateTime objects for cross-time-zone calculations?

Yes, this approach fully supports Bitrix\Main\Type\Date and Bitrix\Main\Type\DateTime objects, providing accurate timestamp conversion and cross-time-zone calculations for ORM field interactions.