mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +00:00
Use localized dates on General Options page. Props nbachiyski. fixes #8153
git-svn-id: https://develop.svn.wordpress.org/trunk@9616 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -112,12 +112,12 @@ function current_time( $type, $gmt = 0 ) {
|
||||
* @param int $unixtimestamp Unix timestamp
|
||||
* @return string The date, translated if locale specifies it.
|
||||
*/
|
||||
function date_i18n( $dateformatstring, $unixtimestamp ) {
|
||||
function date_i18n( $dateformatstring, $unixtimestamp, $gmt = false ) {
|
||||
global $wp_locale;
|
||||
$i = $unixtimestamp;
|
||||
// Sanity check for PHP 5.1.0-
|
||||
if ( -1 == $i )
|
||||
$i = false;
|
||||
if ( intval($i) < 1 )
|
||||
$i = time();
|
||||
|
||||
if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
|
||||
$datemonth = $wp_locale->get_month( date( 'm', $i ) );
|
||||
@@ -136,7 +136,7 @@ function date_i18n( $dateformatstring, $unixtimestamp ) {
|
||||
|
||||
$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
|
||||
}
|
||||
$j = @date( $dateformatstring, $i );
|
||||
$j = $gmt? @gmdate( $dateformatstring, $i ) : @date( $dateformatstring, $i );
|
||||
return $j;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user