Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change time since to j F Y H:i


  • Debora1976
    Participant

    @debora1976

    Hi,

    Is there a function to change the ‘days and hours ago’ into the date and time (for the activity stream etc.)

    Kind regards,
    Debby

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

  • Debora1976
    Participant

    @debora1976


    Debora1976
    Participant

    @debora1976

    And for the activity comments:
    add_filter(‘bp_activity_comment_date_recorded’, ‘bp_activity_comment_date_recorded_newformat’, 10, 2);
    function bp_activity_comment_date_recorded_newformat( $date_recorded ) {
    global $activities_template;

    $timestamp_now = time();
    $timestamp_comment_date_recorded = strtotime( $activities_template->activity->current_comment->date_recorded );

    if (abs($timestamp_now – $timestamp_comment_date_recorded) > 60 * 60 * 24 ) {

    $date_recorded = date_i18n( “j F Y H:i”, $timestamp_comment_date_recorded );
    }
    return $date_recorded;
    }


    jcfromkc
    Participant

    @jcfromkc

    This does not work.

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