protected function getNativeTime($value)
    {
        if (is_numeric($value)) {
            $date = new DateTime("@{$value}");
        } else {
            try {
                $date = new DateTime($value);
            } catch (Exception $e) {
                throw new InvalidArgumentException('Invalid date provided: ' . $value);
            }
        }

        return $date->format('Y-m-d\\TH:i:s\\Z');
    }
protected function getNativeTime($value)
    {
        if (is_numeric($value)) {
            $date = new DateTime("@{$value}");
        } else {
            try {
                $date = new DateTime($value);
            } catch (Exception $e) {
                throw new InvalidArgumentException('Invalid date provided: ' . $value);
            }
        }

        return $date->format('Y-m-d\\TH:i:s\\Z');
    }
protected function getNativeTime ( $ value ) { if ( is_numeric ( $ value ) ) { $ date = new DateTime ( "@{$value}" ) ; } else { try { $ date = new DateTime ( $ value ) ; } catch ( Exception $ e ) { throw new InvalidArgumentException ( 'Invalid date provided: ' . $ value ) ; } } return $ date -> format ( 'Y-m-d\\TH:i:s\\Z' ) ; }
Map value to a proper Elasticsearch date representation.

@param mixed $value

@return string
Map value to a proper Elasticsearch date representation .