Make WordPress Core


Ignore:
Timestamp:
05/14/2009 02:00:32 AM (16 years ago)
Author:
ryan
Message:

Don't localize dates where not appropriate. Props Denis-de-Bernardy, hakre. fixes #9730

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r11312 r11323  
    11781178function the_date_xml() {
    11791179    global $post;
    1180     echo mysql2date('Y-m-d', $post->post_date);
     1180    echo mysql2date('Y-m-d', $post->post_date, false);
    11811181}
    11821182
     
    12371237function get_the_modified_date($d = '') {
    12381238    if ( '' == $d )
    1239         $the_time = get_post_modified_time(get_option('date_format'));
     1239        $the_time = get_post_modified_time(get_option('date_format'), null, null, true);
    12401240    else
    1241         $the_time = get_post_modified_time($d);
     1241        $the_time = get_post_modified_time($d, null, null, true);
    12421242    return apply_filters('get_the_modified_date', $the_time, $d);
    12431243}
     
    12671267
    12681268    if ( '' == $d )
    1269         $the_time = get_post_time(get_option('time_format'), false, $post);
     1269        $the_time = get_post_time(get_option('time_format'), false, $post, true);
    12701270    else
    1271         $the_time = get_post_time($d, false, $post);
     1271        $the_time = get_post_time($d, false, $post, true);
    12721272    return apply_filters('get_the_time', $the_time, $d, $post);
    12731273}
     
    12811281 * @param bool $gmt Whether of not to return the gmt time.
    12821282 * @param int|object $post Optional post ID or object. Default is global $post object.
     1283 * @param bool $translate Whether to translate the time string or not
    12831284 * @return string
    12841285 */
    1285 function get_post_time( $d = 'U', $gmt = false, $post = null ) { // returns timestamp
     1286function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp
    12861287    $post = get_post($post);
    12871288
     
    12911292        $time = $post->post_date;
    12921293
    1293     $time = mysql2date($d, $time);
     1294    $time = mysql2date($d, $time, $translate);
    12941295    return apply_filters('get_post_time', $time, $d, $gmt);
    12951296}
     
    13161317function get_the_modified_time($d = '') {
    13171318    if ( '' == $d )
    1318         $the_time = get_post_modified_time(get_option('time_format'));
     1319        $the_time = get_post_modified_time(get_option('time_format'), null, null, true);
    13191320    else
    1320         $the_time = get_post_modified_time($d);
     1321        $the_time = get_post_modified_time($d, null, null, true);
    13211322    return apply_filters('get_the_modified_time', $the_time, $d);
    13221323}
     
    13291330 * @param string $d Either 'G', 'U', or php date format.
    13301331 * @param bool $gmt Whether of not to return the gmt time.
     1332 * @param int|object $post A post_id or post object
     1333 * @param bool translate Whether to translate the result or not
    13311334 * @return string Returns timestamp
    13321335 */
    1333 function get_post_modified_time( $d = 'U', $gmt = false ) {
    1334     global $post;
     1336function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
     1337    $post = get_post($post);
    13351338
    13361339    if ( $gmt )
     
    13381341    else
    13391342        $time = $post->post_modified;
    1340     $time = mysql2date($d, $time);
     1343    $time = mysql2date($d, $time, $translate);
    13411344
    13421345    return apply_filters('get_the_modified_time', $time, $d, $gmt);
     
    13521355function the_weekday() {
    13531356    global $wp_locale, $post;
    1354     $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date));
     1357    $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
    13551358    $the_weekday = apply_filters('the_weekday', $the_weekday);
    13561359    echo $the_weekday;
     
    13731376    if ( $day != $previousweekday ) {
    13741377        $the_weekday_date .= $before;
    1375         $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date));
     1378        $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
    13761379        $the_weekday_date .= $after;
    13771380        $previousweekday = $day;
Note: See TracChangeset for help on using the changeset viewer.