Documentation

formatDate

string public
\Bitrix\Main\DB\OracleSqlHelper::formatDate(
 string $format,
 string $field = null
);

This non-static method returns database statement for converting $field value according to $format.

The following data is converted:

  • YYYY - A full numeric representation of a year, 4 digits.
  • MMMM - A full textual representation of a month, such as January or March.
  • MM Numeric representation of a month, with leading zeros.
  • MI - Minutes with leading zeros.
  • M - A short textual representation of a month, three letters.
  • DD - Day of the month, 2 digits with leading zeros.
  • HH - 24-hour format of an hour with leading zeros.
  • H - 24-hour format of an hour without leading zeros.
  • GG - 12-hour format of an hour with leading zeros.
  • G - 12-hour format of an hour without leading zeros.
  • SS - Seconds with leading zeros.
  • TT - AM or PM
  • T - AM or PM.

$field$field parameter is SQL unsafe..

Parameters

ParameterDescriptionVersion
$formatFormat.
$fieldDatabase field or expression.

Examples



© «Bitrix24», 2001-2024
Up