public asDate ( integer | string | DateTim\DateTime $value, string $format = null ) : string | ||
$value | integer | string | DateTim\DateTime | the value to be formatted. The following types of value are supported: - an integer representing a UNIX timestamp - a string that can be [parsed to create a DateTime object](http://php.net/manual/en/datetime.formats.php). The timestamp is assumed to be in [[defaultTimeZone]] unless a time zone is explicitly given. - a PHP [DateTime](http://php.net/manual/en/class.datetime.php) object |
$format | string | the format used to convert the value into a date string. If null, [[dateFormat]] will be used. This can be "short", "medium", "long", or "full", which represents a preset format of different lengths. It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime). Alternatively this can be a string prefixed with `php:` representing a format that can be recognized by the PHP [date()](http://php.net/manual/en/function.date.php)-function. |
return | string | the formatted result. |