www.webdeveloper.com
Results 1 to 4 of 4

Thread: php clock in

  1. #1
    Join Date
    Sep 2013
    Posts
    18

    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.....

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,224
    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

    eBookworm.us

  3. #3
    Join Date
    Sep 2013
    Posts
    18
    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..

  4. #4
    Join Date
    Sep 2013
    Posts
    221
    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.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles