I know this is a four year old thread but I wanted to add to @Jescanellas solution.
Pick up at var hours
var hours = (b1 - a1) / 3.6e+6 /24; e.source.getActiveSheet().getRange(dataRow,14).setNumberFormat('h:mm:ss') e.source.getActiveSheet().getRange(dataRow,14).setValue(hours);
By adding the bold, it will display as regular time in hours minutes seconds. (in my .getRange, dataRow is the variable I am using). Thought this might help someone that sees this thread. It took me a while to figure it out.