Extract all users with their last seen date?

Hi !

Is it possible to extract all users with their last seen date from MariaDB ?

Thanks.

What about using the occ command for this task:

#!/bin/sh

sudo -u www-data /srv/www/nextcloud/nextcloud/occ user:list --no-ansi --no-interaction | \
while read line
do
    user=`echo "${line}" | sed 's/^ *- *\([a-z0-9-]*\):.*$/\1/'`

    last_seen=`sudo -u www-data /srv/www/nextcloud/nextcloud/occ user:info --no-ansi --no-interaction "${user}" | \
               grep "last_seen:" | sed 's/^.*last_seen: *//'`

    echo "${user}:${last_seen}"
done

Thanks j-ed !
Due to sed commands errors I made some changes :

#!/bin/bash
sudo -u www-data php /srv/www/html/domain.tld/occ user:list --no-ansi --no-interaction | \
while read line
do
    user=`awk -F: '{print $1}' <<< "${line}" | awk -F"- " '{print $2}'`

    last_seen=`sudo -u www-data php /srv/www/html/domain.tld/occ user:info --no-ansi --no-interaction "${user}" | \
               grep "last_seen:" | sed 's/^.*last_seen: *//'`

	echo "${user}:${last_seen}";
done