Skip to:
Content
Pages
Categories
Search
Top
Bottom

xprofile date output


  • agorafolk
    Participant

    @agorafolk

    Hello everybody,
    I’m looking for a way to output in a good way the birthday of my members. Actually, it outputs 1984-06-27 00:00:00, so is there a way to output it better, like 27 juin 1984 ? In french ? Thank you a lot !
    And have a nice day 🙂
    Alice

Viewing 2 replies - 1 through 2 (of 2 total)

  • Varun Dubey
    Participant

    @vapvarun

    @agorafolk you can use the date_i18n() function provided by WordPress, which formats the date according to your WordPress installation’s language setting.

    // Assume $member_birthday contains the birthday date from the member's profile in the format '1984-06-27 00:00:00'
    $member_birthday = '1984-06-27 00:00:00'; // Replace this with the actual code to get the member's birthday
    
    // Convert the birthday string into a Unix timestamp
    $timestamp = strtotime($member_birthday);
    
    // Format the date in French (e.g., "27 juin 1984")
    $formatted_birthday = date_i18n('j F Y', $timestamp);
    
    echo $formatted_birthday;
    

    agorafolk
    Participant

    @agorafolk

    Thank you for your answer. Is it a code I have to put in function of my child theme ? I use Kleo theme… Thank you a lot !

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar