Forward port fixes for #4294 from 1.3 to 2.x

CakeTime was broken in the same way as TimeHelper was in 1.x. Getting
1969 on invalid input can be very confusing and un-helpful.

Refs #4294