• Resolved GregW

    (@gwmbox)


    I wish to add the Registered date as a Member since, which works but how do I format the date I require?

    d Month yyyy

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter GregW

    (@gwmbox)

    I thought I figured it out, but it is not displaying the date registered?

    I tried using

    <?php
    $registration_date = $user->user_registered; // Get the registration date
    $formatted_date = date_i18n('d F Y', strtotime($registration_date)); // Format the date
    echo esc_html($formatted_date); // Output the formatted date
    ?>
    • This reply was modified 1 year, 8 months ago by GregW.
    Thread Starter GregW

    (@gwmbox)

    ChatGPT to the rescue

    <?php

    $user_id = um_user('ID');
    $registration_date = get_the_author_meta('user_registered', $user_id);
    $formatted_date = date('F j, Y', strtotime($registration_date));?>

    <p><?php echo "Member Since: " . esc_html($formatted_date) ?></p>
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Format Registered date to display’ is closed to new replies.