writing time to file