I am almost certain my previous function worked like a charm before but fails now. Maybe someone can help me? I have the following sample HTML code:
<span id="timetest" data-starttime="<?php echo time(); ?>"><?php echo time(); ?></span>
And then in Jquery I try to get the difference between the time() and the date.now() / 1000 (because of milliseconds) like this:
var startttime = $('#timetest').data('starttime');
var submitttime = Math.floor(Date.now() / 1000);
var totalttime = submitttime - startttime;
But whatever I do the outcome of totaltime = -66 (seconds) ish. What has changed, or what am I doing wrong? Anyone else noticed this issue?