1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
timezone.php
См. документацию.
1
<?php
2
9
namespace
Bitrix\Main\Controller;
10
11
use Bitrix\Main;
12
13
class
Timezone
extends
Main\Engine\Controller
14
{
15
public
function
setAction
(
string
$timezone)
16
{
17
global
$USER
;
18
19
try
20
{
21
new \DateTimeZone($timezone);
22
}
23
catch
(\Throwable)
24
{
25
$this->
addError
(
new
Main
\
Error
(
"Incorrect timezone."
,
"ERR_PARAMS"
));
26
return
null
;
27
}
28
29
$USER
->Update(
30
$USER
->GetID(),
31
[
32
"TIME_ZONE"
=> $timezone,
33
"TIME_ZONE_OFFSET"
=> \CTimeZone::calculateOffset($timezone),
34
]
35
);
36
37
// remember in the current session
38
$USER
->SetParam(
"TIME_ZONE"
, $timezone);
39
40
return
true
;
41
}
42
}
Bitrix\Main\Controller\Timezone
Определения
timezone.php:14
Bitrix\Main\Controller\Timezone\setAction
setAction(string $timezone)
Определения
timezone.php:15
Bitrix\Main\Engine\Controller\addError
addError(Error $error)
Определения
controller.php:1070
Bitrix\Main\Error
Определения
error.php:15
$USER
global $USER
Определения
csv_new_run.php:40
Bitrix\Main\Controller
Определения
agreement.php:2
Bitrix\Main
bitrix
modules
main
lib
controller
timezone.php
Создано системой
1.14.0