Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/bizproc/lib/basetype/value/ |
Upload File : |
<?php namespace Bitrix\Bizproc\BaseType\Value; use Bitrix\Main; class DateTime extends Date { public function __construct($dateFormatted = null, $offset = 0) { $offset = (int) $offset; if ($dateFormatted === null) { $this->timestamp = time(); } elseif (is_numeric($dateFormatted)) { $this->timestamp = (int) $dateFormatted; } else { if (preg_match(static::SERIALIZED_PATTERN, $dateFormatted, $matches)) { $dateFormatted = $matches[1]; $offset = (int) $matches[2]; } try { $datetime = new Main\Type\DateTime($dateFormatted); $this->checkYear($datetime); $this->timestamp = $datetime->getTimestamp() - $offset; } catch (Main\ObjectException $exception) { try { $this->timestamp = (new Main\Type\DateTime($dateFormatted, DATE_ISO8601))->getTimestamp() - $offset; } catch (Main\ObjectException $exception) { $this->timestamp = null; } } } $this->offset = $offset; } public function toSystemObject() { return Main\Type\DateTime::createFromTimestamp($this->getTimestamp()); } public function getFormat() { return Main\Type\DateTime::getFormat(); } }