yii\validators\DateValidator::formatTimestamp PHP Method

formatTimestamp() private method

Formats a timestamp using the specified format
private formatTimestamp ( integer $timestamp, string $format ) : string
$timestamp integer
$format string
return string
    private function formatTimestamp($timestamp, $format)
    {
        if (strncmp($format, 'php:', 4) === 0) {
            $format = substr($format, 4);
        } else {
            $format = FormatConverter::convertDateIcuToPhp($format, 'date');
        }
        $date = new DateTime();
        $date->setTimestamp($timestamp);
        $date->setTimezone(new \DateTimeZone($this->timestampAttributeTimeZone));
        return $date->format($format);
    }