Platformsh\Cli\Util\PropertyFormatter::formatDate PHP Method

formatDate() protected method

protected formatDate ( string $value ) : string
$value string
return string
    protected function formatDate($value)
    {
        $format = null;
        if (isset($this->input) && $this->input->hasOption('date-fmt')) {
            $format = $this->input->getOption('date-fmt');
        }
        $format = $format ?: self::DEFAULT_DATE_FORMAT;
        // Workaround for the ssl.expires_on date, which is currently a
        // timestamp in milliseconds.
        if (substr($value, -3) === '000' && strlen($value) === 13) {
            $value = substr($value, 0, 10);
        }
        $timestamp = is_numeric($value) ? $value : strtotime($value);
        return date($format, $timestamp);
    }