Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
tools.php
1<?php
3
7
8Loc::loadMessages(__FILE__);
9
16class Tools
17{
18 protected static $datetimeTemplate = null;
19
27 public static function getDatetimeExpressionTemplate()
28 {
29 if (self::$datetimeTemplate === null)
30 {
31 $helper = Main\Application::getConnection()->getSqlHelper();
32 $format = Main\Context::getCurrent()->getCulture()->getDateTimeFormat();
33 $datetimeFieldName = '#FIELD#';
34 $datetimeField = $datetimeFieldName;
36 if (\CTimeZone::enabled())
37 {
39 $diff = \CTimeZone::getOffset();
40 if ($diff <> 0)
41 $datetimeField = $helper->addSecondsToDateTime($diff, $datetimeField);
42 unset($diff);
43 }
44 self::$datetimeTemplate = str_replace(
45 array('%', $datetimeFieldName),
46 array('%%', '%1$s'),
47 $helper->formatDate($format, $datetimeField)
48 );
49 unset($datetimeField, $datetimeFieldName, $format, $helper);
50 }
51 return self::$datetimeTemplate;
52 }
53}
static loadMessages($file)
Definition loc.php:64