I recently read Mark Forster’s time management book Do It Tomorrow. In summary it suggests creating a task list on a daily basis, and not doing anything other than from items in that list. Only real emergencies should be dealt with.
If emails arrive that have to be dealt with then add them to tomorrow’s list – that way you have a chance of completing your tasks for a day, and can switch off the computer feeling that you’re finished for the day.
There is also a chapter at the end of the book that says anytime invested in improving systems and processes is time gained. This fits in with the ethos of many programming books – to automate things as much as possible.
As I work on a number of different client projects I use a time tracking database to enter hours worked on a daily basis. It is fairly trivial to get a summary of hours for a month, but what I needed to provide (for invoicing) was a full list of days in a month and hours worked – whether there were values or not.