public static function castFrom($value, string $name = 'Date'): self
    {
        if (is_int($value) || is_string($value) || $value instanceof \DateTime) {
            return new self($value);
        }

        if (!($value instanceof Date)) {
            throw new \InvalidArgumentException(
                    $name . ' must be a timestamp, a string containing time info'
                    . ' or an instance of \DateTime or ' . __CLASS__
                    . ', but was ' . gettype($value)
            );
        }

        return $value;
    }