extract time conversion to helper