Revert "fix TimeOfDay calculation"

This reverts commit 1572a669c0541ba4b8a46a404f5dad05cbc5e261.
more easily maintainable version of TimeOfDay