Convert ticks to time safely