I'll preface this by saying I know next to nothing about javascript. I'm pretty good w/ php, so I understand programming logic, but js is NOT my strong suit.
That being said, here's what I'm looking to do: create a clock that shows the time elapsed since a particular date in Years Months Days Hours:Minutes. I want the clock to run live in the browser.
Can someone please point me in the right direction?
Time elapsed
Moderator: General Moderators
Re: Time elapsed
Imagine you're writing a script in PHP that continually outputs the elapsed time.
What would your printElapsedTime() function look like? We can convert that to Javascript once you know the kind of code needed.
Code: Select all
$elapsed = 12345; // 12,345 seconds have elapsed since the date
do {
printElapsedTime($elapsed);
sleep(1);
$elapsed++;
} while (true);