LP#1552778: copy some date/time utils from OpenSRF