WordPress.org

Ready to get started?Download WordPress

Forums

Change language, last visit member datetime! (2 posts)

  1. 13Q13
    Member
    Posted 3 years ago #

    I got this code for viewing the date & time of the last of a member:

    Add this to functions.php:

    function appthemes_last_login($login) {
        global $user_ID;
        $user = get_userdatabylogin($login);
        update_usermeta($user->ID, 'last_login', current_time('mysql'));
    }
    add_action('wp_login','appthemes_last_login');
    
    function appthemes_get_last_login($user_id) {
        $last_login = get_user_meta($user_id, 'last_login', true);
        $date_format = get_option('date_format') . ' ' . get_option('time_format');
        $the_last_login = mysql2date($date_format, $last_login, false);
        echo $the_last_login;
    }

    In your theme:

    <?php
    global $userdata;
    get_currentuserinfo();
    ?>
    
    <?php _e('You last logged in at:','appthemes'); ?> <?php appthemes_get_last_login($userdata->ID); ?>

    It works, HOWEVER: it displays datetime in ENGLISH.

    e.g. : You last logged in at 24 January 2011 18:40

    But I'd like to have that in DUTCH.

    The language settings in WP are fixed to Dutch though.

    I reckon I have to change the language settings of MySQL??

    Anyone know how to do that?

  2. 13Q13
    Member
    Posted 3 years ago #

    Someone?

Topic Closed

This topic has been closed to new replies.

About this Topic