Returned date format different in Couchbase query window vs. C# .Net query

Hi all,
I’m working on upgrading our system from Couchbase 6 to Couchbase 8 and am running into an issue with it formatting date strings into an incompatible format.

If I run this query in the Couchbase query window

SELECT * FROM database USE KEYS “my_data”

I get something like this:

{
firstName: “John”,
lastName: “Doe”,
createdAt: “2025-12-31T20:14:35Z”
}

This is the date string that is stored in the database, and is the format that is needed. Executing this query from the Query window gives me the correct results.

However, if I execute this query in .Net:

var query = “SELECT * FROM database USE KEYS 'my_data'”;
var result = await cluster.QueryAsync<T>(query);

I get this:

{
firstName: “John”,
lastName: “Doe”,
createdAt: “2025-12-31T20:14:35+00:00”
}

It now sees that createdAt is a date and reformats it into a date string that is incompatible with our system. I never asked it to do this, and it is breaking our code in a lot of places.

This is something new with the most recent updates to the Couchbase SDK as the old system returned the dates simply as their original string.

Is there a way to configure the cluster so that it returns the string that’s stored in the database and doesn’t try to format it into a date? Or, at the very least, specify the format?

The data that our system stores is dynamic, so I can’t use anything in the query itself (like DATE_FORMAT_STR()). I need to set it at a system level.

Thanks for any help.

Can you provide the <T> POCO that you’re using with the query? Is the CreatedAt property a plain string property? The SDK doesn’t really do anything to mutate the data from the query, it just does JSON deserialization using the default or specified deserializer.

At the stage where I’m first intercepting it, it is simply an object (Newtonsoft JObject to be exact). I have yet to serialize it into anything. If the SDK doesn’t mutate the data, then I’m perplexed as to where the issue is coming from.
Previous to the new SDK, the date strings came back correctly. After the new new SDK, the results from the Couchbase query are coming back in a different format (even though they’re just strings in the database) before I’ve done anything with them.

This is all before I serialize it into a class object. That’s where the issue is coming in, since the newly formatted date string won’t serialize into a NodaTime instant. I need to convert it back to the previous datestring format for that to work.

Can you provide the code you’re using to parse the the JObject and extract the data? The code you’re using the run the query and iterate the results would also be helpful.