Problem when making a query with datetime #121
-
I'm trying to make a query of the day, but I think there is some problem with the conversion that sends the datetime to rest API. because it returns incorrect dates. DateTime day1 = DateTime.Now.AddDays(-1); The GET method that sends Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Could you verify that the date is saved correctly in your supabase dashboard and that your column is set up to save a timestamp with timezone? My expectation is that there is a problem between a local timestamp and a UTC timestamp being saved on the server. |
Beta Was this translation helpful? Give feedback.
-
Yes, the column is created as timestamp, Look, the request to the server is in dd MM yyyy format. Doing the query manually, it works. It has to be something with Postgre BaseModel, which doesn't do the conversion well.
|
Beta Was this translation helpful? Give feedback.
-
Hi Joseph It's strange because the Datetime insert puts the date correctly and when you use LINQ it puts the date format wrong. At the moment you can work well by doing the query without using LINQ. Thanks for your quick response. |
Beta Was this translation helpful? Give feedback.
Good catch - it was an assumption that we should convert to
ToUniversalTime
that was an incorrect assumption to make. This is fixed in[email protected]
and[email protected]
. Thanks!