Hi!
I have a problem with DateTime type. Api Server and DB are on different servers. So we have some problem with sync time. When i used DateTime.UtcNow, PostgeSQL takes query with "CURRENT_TIMESTAMP AT TIME ZONE 'UTC')", but needed send requests from API server by datetime value of the DateTime.UtcNow. Is there any way to build query with value.
P.S. Sorry for my english.
DateTime.Now converting
Re: DateTime.Now converting
Please use
instead of
Code: Select all
var a = DateTime.UtcNow;
[...].GetAll(true).Where(x => x.CreatedDate < a).OrderByDescending(x => x.CreatedDate)[...]
// converted to WHERE ("Extent1".createddate < :p__linq__0)
Code: Select all
[...].GetAll(true).Where(x => x.CreatedDate < DateTime.UtcNow).OrderByDescending(x => x.CreatedDate)[...]
// converted to WHERE ("Extent1".createddate < (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'))