1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
datetime.php
См. документацию.
1<?php
2
3namespace Bitrix\Bizproc\BaseType\Value;
4
5use Bitrix\Main;
6
7class DateTime extends Date
8{
9 public function __construct($dateFormatted = null, $offset = 0)
10 {
11 $offset = (int) $offset;
12
13 if ($dateFormatted === null)
14 {
15 $this->timestamp = time();
16 }
17 elseif (is_numeric($dateFormatted))
18 {
19 $this->timestamp = (int) $dateFormatted;
20 }
21 else
22 {
23 if (preg_match(static::SERIALIZED_PATTERN, $dateFormatted, $matches))
24 {
25 $dateFormatted = $matches[1];
26 $offset = (int) $matches[2];
27 }
28
29 try
30 {
31 $datetime = new Main\Type\DateTime($dateFormatted);
32 $this->checkYear($datetime);
33
34 $this->timestamp = $datetime->getTimestamp() - $offset;
35 }
36 catch (Main\ObjectException $exception)
37 {
38 try
39 {
40 $this->timestamp = (new Main\Type\DateTime($dateFormatted, DATE_ISO8601))->getTimestamp() - $offset;
41 }
42 catch (Main\ObjectException $exception)
43 {
44 $this->timestamp = null;
45 }
46 }
47 }
48
49 $this->offset = $offset;
50 }
51
52 public function toSystemObject()
53 {
55 }
56
57 public function getFormat()
58 {
60 }
61}
__construct($dateFormatted=null, $offset=0)
Определения datetime.php:9
Определения date.php:9
static getFormat(Context\Culture $culture=null)
Определения date.php:264
getTimestamp()
Определения date.php:218
static createFromTimestamp($timestamp)
Определения datetime.php:246
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$matches
Определения index.php:22