public function getTime()
    {
        // Time should only be used with the history state.
        if (!$this->isHistory()) {
            return new DateTime('now');
        }

        $timestamp = $this->session->get($this->timePersistenceKey, time());

        return (new DateTime())->setTimestamp($timestamp);
    }