Trivial backport of datetime functionality to Python 2.6.

Change-Id: I624f23e668140dcdc5500342e056e5246637ab32