Fix TelemetryDataBaseService.GetAsync Db dateTime timezone TimestampBehavior

This commit is contained in:
ngfrolov 2023-09-11 15:21:36 +05:00
parent 1c1a33aeee
commit 5e0ab46e57
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -166,10 +166,16 @@ namespace AsbCloudInfrastructure.Services.SAUB
.AsNoTracking(); .AsNoTracking();
if (request.GeDate.HasValue) if (request.GeDate.HasValue)
query = query.Where(d => d.DateTime >= request.GeDate); {
var geDate = request.GeDate.Value.UtcDateTime;
query = query.Where(d => d.DateTime >= geDate);
}
if (request.LeDate.HasValue) if (request.LeDate.HasValue)
query = query.Where(d => d.DateTime >= request.LeDate); {
var leDate = request.LeDate.Value.UtcDateTime;
query = query.Where(d => d.DateTime <= leDate);
}
if (request.Divider > 1) if (request.Divider > 1)
query = query.Where((d) => (((d.DateTime.DayOfYear * 24 + d.DateTime.Hour) * 60 + d.DateTime.Minute) * 60 + d.DateTime.Second) % request.Divider == 0); query = query.Where((d) => (((d.DateTime.DayOfYear * 24 + d.DateTime.Hour) * 60 + d.DateTime.Minute) * 60 + d.DateTime.Second) % request.Divider == 0);