see last login from user wordpress code example
Example: last login date time in wordpress
#Set
function user_last_login( $user_login, $user ) {
update_user_meta( $user->ID, 'last_login', time() );
}
add_action( 'wp_login', 'user_last_login', 10, 2 );
#get
echo get_user_meta( $user->ID, 'last_login' , true );