• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/database.php
  • Класс: CAllDatabase
  • Вызов: CAllDatabase::FormatDate
static function FormatDate($strDate, $format="DD.MM.YYYY HH:MI:SS", $new_format="DD.MM.YYYY HH:MI:SS")
{
	if (empty($strDate))
		return false;

	if ($format===false && defined("FORMAT_DATETIME"))
		$format = FORMAT_DATETIME;

	$fromPhpFormat = MainTypeDate::convertFormatToPhp($format);

	$time = false;
	try
	{
		$time = new MainTypeDateTime($strDate, $fromPhpFormat);
	}
	catch(MainObjectException $e)
	{
	}

	if ($time !== false)
	{
		//Compatibility issue
		$fixed_format = preg_replace(
			array(
				"/(?format($toPhpFormat);
	}

	return false;
}