I have the following code
function app_searched_today_visitbh() {
global $wpdb;
$horas = $wpdb->get_var("SELECT time_format(timediff(now(),date_people),'%i%h') FROM today_people LIMIT 1");
return ("<span id='days_since'>$horas</span>");
}
add_shortcode('appsearchedtodayvisitbh', 'app_searched_today_visitbh');
Its operation is as follows, add the result of DATE in a span
consulting the database, in a table today_people
with a column date_people
of DATETIME format,
UPDATE
This code is a bit old, what I really need, is that it is like a visit counter but manual, that I leave the number 5, and start every minute to increase. No need for cookies or localstorage.
Thank you very much! I'm waiting for your help!