public static function convertToEdmDateTime($value)
    {
        if (empty($value)) {
            return $value;
        }

        if (is_string($value)) {
            $value = self::convertToDateTime($value);
        }

        Validate::isDate($value, 'value');

        $cloned = clone $value;
        $cloned->setTimezone(new \DateTimeZone('UTC'));

        return str_replace('+0000', 'Z', $cloned->format(\DateTime::ISO8601));
    }