fix time conversion