- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/db/sqlhelper.php
- Класс: BitrixMainDBSqlHelper
- Вызов: SqlHelper::formatDate
public function formatDate($format, $field = null); /** * Returns function for getting part of string. ** If length is null or omitted, the substring starting * from start until the end of the string will be returned. *
* $str and $from parameters are SQL unsafe. * * @param string $str Database field or expression. * @param integer $from Start position. * @param integer $length Maximum length. * * @return string */ public function getSubstrFunction($str, $from, $length = null) { $sql = 'SUBSTR('.$str.', '.$from; if (!is_null($length)) $sql .= ', '.$length; return $sql.')'; }