I have a database that will be logging calls from a PBX. The pbx will be sending call info, and the script will first insert a record with ID, call info, and the current date/time. Once the call is hung up, the script should update the record by pulling the starting time, calculating the difference between then and now, and inserting the duration back into the same record (using the id as a reference). I think I have it all except the duration calculation; what would the best way to handle this be? It must be done within the PHP, this isn't something we can create a SP for or anything.