Elgg  Version 5.1
Public Member Functions | Protected Member Functions | List of all members
Elgg\I18n\DateTime Class Reference

Extension of the DateTime class to support formating a date using the locale. More...

Inheritance diagram for Elgg\I18n\DateTime:

Public Member Functions

 formatLocale (string $format, string $language=null)
 Try to format the date using locale output. More...
 

Protected Member Functions

 dateFormatToStrftime (string $dateFormat)
 Convert a date format to a strftime format. More...
 
 formatStrftime (string $format, string $language)
 Try to format to a locale using strftime() More...
 
 dateFormatToICU (string $dateFormat)
 Convert a date format to a ICU format. More...
 
 formatIntl (string $format, string $language)
 Try to format to a locale using the 'intl' PHP module. More...
 

Detailed Description

Extension of the DateTime class to support formating a date using the locale.

Since
3.0

Definition at line 12 of file DateTime.php.

Member Function Documentation

Elgg\I18n\DateTime::dateFormatToICU ( string  $dateFormat)
protected

Convert a date format to a ICU format.

Parameters
string$dateFormata date format
Returns
false|string
See also
https://secure.php.net/manual/en/function.strftime.php#96424
Since
4.1

Definition at line 125 of file DateTime.php.

Elgg\I18n\DateTime::dateFormatToStrftime ( string  $dateFormat)
protected

Convert a date format to a strftime format.

Timezone conversion is done for unix. Windows users must exchange z and Z.

Unsupported date formats : n, t, L, B, u, e, I, P, Z, c, r Unsupported strftime formats : U, W, C, g, r, R, T, X, c, D, F, x

Parameters
string$dateFormata date format
Returns
false|string
See also
https://secure.php.net/manual/en/function.strftime.php#96424

Definition at line 54 of file DateTime.php.

Elgg\I18n\DateTime::formatIntl ( string  $format,
string  $language 
)
protected

Try to format to a locale using the 'intl' PHP module.

Parameters
string$formatoutput format, supports date() formatting
string$languagethe output language
Returns
string|false
Since
4.1

Definition at line 161 of file DateTime.php.

Elgg\I18n\DateTime::formatLocale ( string  $format,
string  $language = null 
)

Try to format the date using locale output.

Parameters
string$formatoutput format, supports date() formatting
string$languagethe output language, defaults to current language
Returns
string

Definition at line 22 of file DateTime.php.

Elgg\I18n\DateTime::formatStrftime ( string  $format,
string  $language 
)
protected

Try to format to a locale using strftime()

Parameters
string$formatoutput format, supports date() formatting
string$languagethe output language
Returns
string|false
Since
4.1

Definition at line 94 of file DateTime.php.


The documentation for this class was generated from the following file: