Get Last Login Time for Current User and Format Date using Bricks

I have this snippet that does the job for outputting the user’s last login time

$user = wp_get_current_user();
$last_login = get_user_meta( $user->ID, 'last_login', true );
if ( $last_login ) {
    $last_login_time = date_i18n( 'd-m-Y', strtotime( $last_login ) );
    echo '<p>Last Login: ' . esc_html( $last_login_time ) . '</p>';
}

I’d like to use bricks dynamic tags to output this data on the frontend.
This tag works: {wp_user_meta:last_login} but outputs it as: 2023-04-09 20:38:43
I’d like to output it in dd-mm-yyyy format and no time. But I’m unsure how to do that.

It seems like this bit from the documentation would get me there

:text value – Depending on the context it could mean the following:
User or term custom field meta key
The URL parameter key
Post terms separator
Date format
Image size slug (e.g. thumbnail, or full)
The echo tag function name

But is unclear. Any direction is appreciated.

You can just use {echo:my_function_name}
To get the output of your snippet.

Right! And that does work, the problem is the format of the date and the inclusion of time. I want to use the tag and format the date a specific way and that doesn’t seem to be possible when echoing functions in this manner.

$user = wp_get_current_user();
$last_login = get_user_meta( $user->ID, ‘last_login’, true );
if ( $last_login ) {
$last_login_time = date(‘m/d/Y’, $last_login);
return $last_login_time;
}
return ‘No date placeholder’;

Would that do it? I’m far from expert… but I don’t think you need strtotime with a Unix timestamp… just treat it as a timestamp and select required date format.