Fix duration, add new function for timestamp formatting