Habari\Format::format_date PHP Метод

format_date() публичный статический Метод

Example: If $dt is a DateTime for December 10, 2008... echo $dt->format_date('
{F} {j}, {Y}
'); Output:
December 10, 2008
public static format_date ( DateTime $date, string $format ) : string
$date DateTime The date to format
$format string A string with date()-like letters within braces to replace with date components
Результат string The formatted string
    public static function format_date($date, $format)
    {
        if (!$date instanceof DateTime) {
            $date = DateTime::create($date);
        }
        return $date->text_format($format);
    }