1

I am a bit lost at where to start I created a html page with users and clock in and clock out values displayed in a table. I want to write a script which continues a timer from clock in and stops at clock out. I am a really rusty with javascript

anony12
  • 11
  • 2
  • What's your progress so far? – I am L Nov 26 '19 at 08:25
  • You need to describe your scenario in greater detail. You've tagged your question with sql. Are the time in and time out values stored in a database? Will you need to write both backend and frontend (javascript) code? – mortb Nov 26 '19 at 08:30
  • @mortb I created a table with the rows names, punch in , punch out , time spent. I have the rows punch in and punch out working perfectly but the time spent is where I want the timer to be I tried timestampdiff in sql but it will only work if the two values punch in and out exist(that was the reason I created time spent row ). What I want i the time should start from when the user punched in and stop when the person punched out please – anony12 Nov 26 '19 at 08:49
  • @IamL I am done with everything is just left with the script for the time spent so it displays on the html table. – anony12 Nov 26 '19 at 08:50
  • @anony12: If you are using MySQL you could use the function `CURRENT_TIMESTAMP()` as input to the `timestampdiff` function. That will get you the difference between now and checkin time – mortb Nov 26 '19 at 10:38
  • This answer would tell you how to create a html table using javascript https://stackoverflow.com/questions/14643617/create-table-using-javascript – mortb Nov 26 '19 at 10:39
  • Be sure to read: https://stackoverflow.com/help/how-to-ask – mortb Nov 26 '19 at 10:47

0 Answers0