Factor out the code for decoding the time axis.