move time related functions to their own file