added unit tests to fix a bug in TimeUtils
That bug must have been around for a long time... I should write more unit tests.