src/Widop/Twitter/Options/AbstractDateTimeOption.php
public function setValue($value)
    {
        if (is_string($value)) {
            try {
               $value = new \DateTime($value);
            } catch (\Exception $e) {
                throw new \InvalidArgumentException($e->getMessage());
            }
        }

        if (!($value instanceof \DateTime) && ($value !== null)) {
            throw new \InvalidArgumentException(sprintf(
                'The option "%s" only accepts \DateTime objects or strings.',
                $this->getName()
            ));
        }

        parent::setValue($value);
    }
public function setValue($value)
    {
        if (is_string($value)) {
            try {
               $value = new \DateTime($value);
            } catch (\Exception $e) {
                throw new \InvalidArgumentException($e->getMessage());
            }
        }

        if (!($value instanceof \DateTime) && ($value !== null)) {
            throw new \InvalidArgumentException(sprintf(
                'The option "%s" only accepts \DateTime objects or strings.',
                $this->getName()
            ));
        }

        parent::setValue($value);
    }
{@inheritdoc}