Work time tracking

28. April 2020

I work as a software engineer for some years now and until the beginning of last year I worked about 3 years as an external developer (aka "consultant") for several clients, with placement periods ranging from 1 month to about 1.5 years as the longest.

The problem which arose every time was that as an external employee, you wouldn't have access to the time tracking system, or in some cases not even get a badge. So it was expected that you would track the time yourself, but on the other side that the billing would be as exact as possible (so the customer wouldn't get under- or overcharged).

Tracking time

As I saw some of my colleagues take notes on scrap paper that was when I decided to write a little script, (see on Github), to track my working time.

You can run it with


As it starts, you'll get a simple menu in which you can either create a new timestamp with "X", or just press enter to see the daily working times.

It looks like this:

The times are also rounded (to a quarter-hour) and shown in the last column, as this is as exact as most customers expect.

The cool thing is, that it will read and write from a simple JSON file, so you can also edit/correct it by hand, or add bulk times from another application. The times you see in the screenshot above are generated by the following JSON:

    "2019-08-14": [
    "2019-08-15": [
    "2019-08-16": [

As you can see, if there is an uneven amount of stamps, the script will just show the amount of stamps but not show any time, to indicate that that particular day needs fixing.

If this happens on the current day (for example, after checking in after lunch) the current working time at the time running the script is calculated, and an asterisk is added to indicate the temporary calculation:

(Oh no, still another two hours to go for today...)

Written in about an hour, I found this little script to be quite useful and also providing some proper way to track my working time. Especially since sometimes the feeling of how long a day was and the actual duration can differ by quite some amount :-)

Happy tracking!


Coding Misc