DateTimeFormatter
in package

Date class to manage dates.

Tags
see
DateTime::start()

Table of Contents

__construct()  : mixed
getCalendar() Returns the calendar  : IntlCalendar|null
getFormattedDate() Returns the given date as string into the setted locale with the setted formats  : string
getFormattedDateTime() Returns the given date as string into the setted locale with the setted formats  : string
getFormatter() Returns the IntlDateFormatter with the setted formats  : IntlDateFormatter
getPattern() Returns the pattern date as string with the setted formats  : string
getTimezone() Returns the timeZone  : DateTimeZone|null
init() Initialize the object, sets the locale value and timezone  : void

Methods

__construct()

public __construct([mixed $dateType = null ][, mixed $timeType = null ][, mixed $calendarType = null ]) : mixed
Parameters
$dateType : mixed = null
$timeType : mixed = null
$calendarType : mixed = null
Return values
mixed

getCalendar()

Returns the calendar

public static getCalendar() : IntlCalendar|null
Return values
IntlCalendar|null

getFormattedDate()

Returns the given date as string into the setted locale with the setted formats

public getFormattedDate([mixed $dateTime = null ][, mixed $format = null ]) : string
Parameters
$dateTime : mixed = null
$format : mixed = null
Return values
string

getFormattedDateTime()

Returns the given date as string into the setted locale with the setted formats

public getFormattedDateTime([mixed $dateTime = null ][, mixed $format = null ]) : string
Parameters
$dateTime : mixed = null
$format : mixed = null
Return values
string

getFormatter()

Returns the IntlDateFormatter with the setted formats

public getFormatter([mixed $format = null ][, bool $time = true ]) : IntlDateFormatter
Parameters
$format : mixed = null
$time : bool = true
Return values
IntlDateFormatter

getPattern()

Returns the pattern date as string with the setted formats

public getPattern() : string
Return values
string

getTimezone()

Returns the timeZone

public static getTimezone() : DateTimeZone|null
Return values
DateTimeZone|null

init()

Initialize the object, sets the locale value and timezone

public static init(string $locale) : void
Parameters
$locale : string
Return values
void

Search results