Make WordPress Core


Ignore:
Timestamp:
11/11/2008 07:56:35 PM (16 years ago)
Author:
ryan
Message:

Use localized dates on General Options page. Props nbachiyski. fixes #8153

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r9444 r9616  
    113113 * @return string The date, translated if locale specifies it.
    114114 */
    115 function date_i18n( $dateformatstring, $unixtimestamp ) {
     115function date_i18n( $dateformatstring, $unixtimestamp, $gmt = false ) {
    116116    global $wp_locale;
    117117    $i = $unixtimestamp;
    118118    // Sanity check for PHP 5.1.0-
    119     if ( -1 == $i )
    120         $i = false;
     119    if ( intval($i) < 1 )
     120        $i = time();
    121121
    122122    if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
     
    137137        $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
    138138    }
    139     $j = @date( $dateformatstring, $i );
     139    $j = $gmt? @gmdate( $dateformatstring, $i ) : @date( $dateformatstring, $i );
    140140    return $j;
    141141}
Note: See TracChangeset for help on using the changeset viewer.