I've got some PHP code where it says the time you signed up, and gives an approximation of how long ago it was.
I've been looking into trying to refresh it with javascript, but I'm struggling to find exactly what I'm after, and as my knowledge of it isn't good I'm a bit stuck on getting it working now.
Basically, this is the code I currently have, with the function being the thing displaying the time since singing up
Date registered: <?PHP echo date('jS F Y', $_SESSION['User_Date']). at .date('G:i:s', $_SESSION['User_Date']);
echo (.time_delta('now',date('F j Y G:i:s', $_SESSION['User_Date'])).); ?>
Which will output something like:
Date registered: 4th November 2013 at 0:57:31 (About 34 minutes ago)
And I've got this for javascript, but I don't know how to make it just update the text and not redirect the page.
<script>
setInterval(function() {
window.location.href = timeupdate.php;
}, 1000);
</script>
Would there be a simple way to do this, or is it worth avoiding it in terms of cpu usage?