Property | Type | Description | |
---|---|---|---|
$formatInfo | The DateTimeFormatInfo, containing culture specific patterns and names. | ||
$methods | array | A list of methods, to be used by the token function calls. | |
$tokens | array | A list of tokens and their function call. |
Method | Description | |
---|---|---|
__construct ( $formatInfo = null ) : |
Initialize a new DateFormat. | |
format ( $time, $pattern = 'F', $charset = 'UTF-8' ) : string | Format a date according to the pattern. |
Method | Description | |
---|---|---|
getAMPM ( $date, $pattern = 'a' ) : string | Get the AM/PM designator, 12 noon is PM, 12 midnight is AM. | |
getDay ( $date, $pattern = 'd' ) : string | Get the day of the month. | |
getDayInMonth ( $date, $pattern = 'FF' ) : integer | Get day in the month. | |
getDayInWeek ( $date, $pattern = 'EEEE' ) : string | Get the day of the week. | |
getDayInYear ( $date, $pattern = 'D' ) : integer | Get the day in the year, e.g. [1-366] | |
getEra ( $date, $pattern = 'G' ) : string | Get the era. i.e. in gregorian, year > 0 is AD, else BC. | |
getFunctionName ( $token ) : mixed | For a particular token, get the corresponding function to call. | |
getHour12 ( $date, $pattern = 'h' ) : string | Get the hours in 12 hour format. | |
getHour24 ( $date, $pattern = 'H' ) : string | Get the hours in 24 hour format, i.e. [0-23]. | |
getHourInAMPM ( $date, $pattern = 'K' ) : integer | Get the hours in AM/PM format, e.g [1-12] | |
getHourInDay ( $date, $pattern = 'k' ) : integer | Get the hours [1-24]. | |
getMinutes ( $date, $pattern = 'm' ) : string | Get the minutes. | |
getMonth ( $date, $pattern = 'M' ) : string | Get the month. | |
getPattern ( $pattern ) : string | Get the pattern from DateTimeFormatInfo or some predefined patterns. | |
getSeconds ( $date, $pattern = 's' ) : string | Get the seconds. | |
getTimeZone ( $date, $pattern = 'z' ) : string | Get the timezone from the server machine. | |
getTokens ( $pattern ) : array | Tokenize the pattern. The tokens are delimited by group of similar characters, e.g. 'aabb' will form 2 tokens of 'aa' and 'bb'. | |
getWeekInMonth ( $date, $pattern = 'W' ) : integer | Get week in the month. | |
getWeekInYear ( $date, $pattern = 'w' ) : integer | Get the week in the year. | |
getYear ( $date, $pattern = 'yyyy' ) : string | Get the year. |
public __construct ( $formatInfo = null ) : |
||
return | instance |
protected getDayInMonth ( $date, $pattern = 'FF' ) : integer | ||
return | integer | day in month |
protected getDayInWeek ( $date, $pattern = 'EEEE' ) : string | ||
return | string | day of the week. |
protected getDayInYear ( $date, $pattern = 'D' ) : integer | ||
return | integer | hours in AM/PM format. |
protected getFunctionName ( $token ) : mixed | ||
return | mixed | the function if good token, null otherwise. |
protected getHourInAMPM ( $date, $pattern = 'K' ) : integer | ||
return | integer | hours in AM/PM format. |
protected getHourInDay ( $date, $pattern = 'k' ) : integer | ||
return | integer | hours [1-24] |
protected getMinutes ( $date, $pattern = 'm' ) : string | ||
return | string | minutes. |
protected getPattern ( $pattern ) : string | ||
return | string | a pattern. |
protected getSeconds ( $date, $pattern = 's' ) : string | ||
return | string | seconds |
protected getTimeZone ( $date, $pattern = 'z' ) : string | ||
return | string | time zone |
protected getWeekInMonth ( $date, $pattern = 'W' ) : integer | ||
return | integer | week in month |
protected getWeekInYear ( $date, $pattern = 'w' ) : integer | ||
return | integer | week in year |
protected DateTimeFormatInfo,Prado\I18N\core $formatInfo | ||
return |
protected array $methods | ||
return | array |
protected array $tokens | ||
return | array |