public function setTime(DateTime $time = null)
    {
        $timestamp = $time ? $time->getTimestamp() : null;

        $this->session->put($this->timePersistenceKey, $timestamp);

        if ($time) {
            $this->setState(static::HISTORY);
        }

        return $this;
    }