Moved time to length conversion to backend