php clock in
presently am dng Staff management prjt...
how to insert clock in and out times in database...
how can i calculate timesheet difference .....!
any one give an idea...
thanks in advance.....
Use a timestamp or datetime type column in the database, and use the database's built-in time arithmetic functions to get the difference. E.g., in MySQL, you might use the TIMEDIFF() function.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
actually my problem is in front end
when i click the clock in button ... it display the current time... (that code be writen in jas)
your clock in time is....... like ths
i want to insert that clock in time in database...
how can i insert that time...
please help me...
thanks in advance..
Try this one.
You can first display the date and then save the same in the database.
If the table definition has the timestamp column default set to CURRENT_TIMESTAMP, you actually don't have to do anything at all. Otherwise, NOW() and CURRENT_TIMESTAMP will work, as in:
INSERT INTO t1 (timestamp_column) VALUES (NOW());
Hope this helps you.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)