1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
datetime.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Bizproc\BaseType\Value;
4
5
use Bitrix\Main;
6
7
class
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
{
54
return
Main\Type\DateTime::createFromTimestamp
($this->
getTimestamp
());
55
}
56
57
public
function
getFormat
()
58
{
59
return
Main\Type\DateTime::getFormat
();
60
}
61
}
Bitrix\Bizproc\BaseType\Value\DateTime\toSystemObject
toSystemObject()
Определения
datetime.php:52
Bitrix\Bizproc\BaseType\Value\DateTime\getFormat
getFormat()
Определения
datetime.php:57
Bitrix\Bizproc\BaseType\Value\DateTime\__construct
__construct($dateFormatted=null, $offset=0)
Определения
datetime.php:9
Bitrix\Main\ObjectException
Определения
ObjectException.php:9
Bitrix\Main\Type\Date
Определения
date.php:9
Bitrix\Main\Type\Date\getFormat
static getFormat(Context\Culture $culture=null)
Определения
date.php:264
Bitrix\Main\Type\Date\getTimestamp
getTimestamp()
Определения
date.php:218
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
Bitrix\Main\Type\DateTime\createFromTimestamp
static createFromTimestamp($timestamp)
Определения
datetime.php:246
Bitrix\Main
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$matches
$matches
Определения
index.php:22
bitrix
modules
bizproc
lib
basetype
value
datetime.php
Создано системой
1.14.0