Retrieve the date in localized format, based on timestamp.
If the locale specifies the locale month and weekday, then the locale will take over the format for the date. If it isn’t, then the date format string will be used instead.
Signature
date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false )
- dateformatstring
- (string) Format to display the date.
- unixtimestamp
- (int) Optional. Unix timestamp.
Default:false - gmt
- (boolean) Optional, default is false. Whether to convert to GMT for time.
Default:false
Return
(string) The date, translated if locale specifies it.
Source
WP Trac GitHub Bitbucketfunction date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { global $wp_locale; $i = $unixtimestamp; if ( false === $i ) { if ( ! $gmt ) $i = current_time( 'timestamp' ); else $i = time(); // we should not let date() interfere with our // specially computed timestamp $gmt = true; } // store original value for language with untypical grammars // see http://core.trac.wordpress.org/ticket/9396 $req_format = $dateformatstring; $datefunc = $gmt? 'gmdate' : 'date';39 more lines...
Link here
-
URL
http://queryposts.com/function/date_i18n/ -
HTML
<a href='http://queryposts.com/function/date_i18n/'>date_i18n()</a> -
Markdown
[date_i18n()](http://queryposts.com/function/date_i18n/) -
BBCode
[url=http://queryposts.com/function/date_i18n/]date_i18n()[/url]