<?php

$dt_now = "2021-12-31 12:00:30";
$last_connection = "2021-12-31 12:00:00";
                        $dt_difference = strtotime($dt_now) - strtotime($last_connection);
                        echo $dt_difference;


?>

