29 if (self::$datetimeTemplate ===
null)
31 $helper = Main\Application::getConnection()->getSqlHelper();
32 $format = Main\Context::getCurrent()->getCulture()->getDateTimeFormat();
33 $datetimeFieldName =
'#FIELD#';
34 $datetimeField = $datetimeFieldName;
36 if (\CTimeZone::enabled())
39 $diff = \CTimeZone::getOffset();
41 $datetimeField = $helper->addSecondsToDateTime($diff, $datetimeField);
44 self::$datetimeTemplate = str_replace(
45 array(
'%', $datetimeFieldName),
47 $helper->formatDate($format, $datetimeField)
49 unset($datetimeField, $datetimeFieldName, $format, $helper);
51 return self::$datetimeTemplate;