PHP 클래스 Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToLocalizedStringTransformer

Options: * "input": The type of the normalized format ("time" or "timestamp"). Default: "datetime" * "output": The type of the transformed format ("string" or "array"). Default: "string" * "format": The format of the time string ("short", "medium", "long" or "full"). Default: "short"
저자: Bernhard Schussek ([email protected])
저자: Florian Eckerstorfer ([email protected])
상속: extends Symfony\Component\Form\Extension\Core\DataTransformer\BaseDateTimeTransformer
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $inputTimezone = null, string $outputTimezone = null, integer $dateFormat = null, integer $timeFormat = null, IntlDateFormatter $calendar = IntlDateFormatter::GREGORIAN, string $pattern = null ) Constructor.
reverseTransform ( string | array $value ) : DateTime Transforms a localized date string/array into a normalized date.
transform ( DateTime $dateTime ) : string | array Transforms a normalized date into a localized date string/array.

보호된 메소드들

메소드 설명
getIntlDateFormatter ( ) : IntlDateFormatter Returns a preconfigured IntlDateFormatter instance

메소드 상세

__construct() 공개 메소드

Constructor.
또한 보기: BaseDateTimeTransformer::formats for available format options
public __construct ( string $inputTimezone = null, string $outputTimezone = null, integer $dateFormat = null, integer $timeFormat = null, IntlDateFormatter $calendar = IntlDateFormatter::GREGORIAN, string $pattern = null )
$inputTimezone string The name of the input timezone
$outputTimezone string The name of the output timezone
$dateFormat integer The date format
$timeFormat integer The time format
$calendar IntlDateFormatter An \IntlDateFormatter instance
$pattern string A pattern to pass to \IntlDateFormatter

getIntlDateFormatter() 보호된 메소드

Returns a preconfigured IntlDateFormatter instance
protected getIntlDateFormatter ( ) : IntlDateFormatter
리턴 IntlDateFormatter

reverseTransform() 공개 메소드

Transforms a localized date string/array into a normalized date.
public reverseTransform ( string | array $value ) : DateTime
$value string | array Localized date string/array
리턴 DateTime Normalized date

transform() 공개 메소드

Transforms a normalized date into a localized date string/array.
public transform ( DateTime $dateTime ) : string | array
$dateTime DateTime Normalized date.
리턴 string | array Localized date string/array.