Cast to double when converting time, same as in the tests.