Craft only stores the most recent login date for users (i.e. the lastLoginDate
). To get a list of all users and their last login date, you could do something like this:
{% set users = craft.users.can('accessCp').all() %}
<table>
<tr>
<th>Username</th>
<th>Last login</th>
</tr>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.lastLoginDate|default ? user.lastLoginDate|date('Y-m-d H:i:s') }}</td>
</tr>
{% endfor %}
</table>
If you need to retain a more comprehensive login history, as opposed to only the most recent login date, you could try the Audit plugin.