Fixed code and tests to take UTC into account.