Get last seen date/time in wordpress get_comments() [closed]

WordPress already have such function in its core. It’s called ‘human_time_diff’ and it’s used in WP admin section.

Usage is pretty simple:

echo human_time_diff( $from, $to );

where $from is Unix timestamp from which the difference begins and $to is Unix timestamp to end the time difference (or time() by default).

So you’ll have to use strtotime function to convert date to timestamp.

Here you can find more info about it and some examples: https://codex.wordpress.org/Function_Reference/human_time_diff