i18n\Formatter asTime()

asTime() public method

Formats the value as a time.

See also $timeFormat.

public string asTime ( $value, $format = null )
$value integer|string|DateTime

The value to be formatted. The following types of value are supported:

$format string

The format used to convert the value into a date string. If null, $timeFormat 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.

Alternatively this can be a string prefixed with php: representing a format that can be recognized by the PHP date()-function.

return string

The formatted result.

throws yii\base\InvalidParamException

if the input value can not be evaluated as a date value.

throws yii\base\InvalidConfigException

if the date format is invalid.

doc_Yii
2016-10-30 17:06:03
Comments
Leave a Comment

Please login to continue.