I am doing a lot of websites at the moment and i need to time the work i am doing.

I want to create a script where i can select a site i am currently working on from a list and then it will start a timer. When i have finished i can just click stop and the time difference from the original time will be added to the database.

I know how to do everything in the script except get the time, should i use javascript to display realtime updates or use the php echo gmDate ("H:i:s");

If i use the gmdate function can i use the original time minus the new time? or would i have to define each part of the date to a variable, e.g.

$hours = gmDate ("H");
$minutes = gmDate ("i");
$seconds = gmDate ("s");

Any help or advice would be greatly appreciated.

  • Max Slade

    Try this date("H:i:s"); it will generate a timestamp

      Is there any way in javascript that i could create something that starts counting when the page is loaded and when i click on the submit button the php code adds the amount of seconds to a database?? Thats what i want to do, sorry about the confusing stuff earlier!!

        Write a Reply...