diff --git a/AsbCloudApp/Requests/MessageRequest.cs b/AsbCloudApp/Requests/MessageRequest.cs index 1bfba1a2..a474c7b9 100644 --- a/AsbCloudApp/Requests/MessageRequest.cs +++ b/AsbCloudApp/Requests/MessageRequest.cs @@ -17,12 +17,12 @@ namespace AsbCloudApp.Requests /// /// начальная дата /// - public DateTime? Begin { get; set; } + public DateTimeOffset? Begin { get; set; } /// /// конечная дата /// - public DateTime? End { get; set; } + public DateTimeOffset? End { get; set; } /// /// строка поиска diff --git a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs index 350829e1..a4d1f841 100644 --- a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs @@ -72,13 +72,13 @@ namespace AsbCloudInfrastructure.Services.SAUB if (request.Begin is not null) { - var beginUtc = request.Begin.Value.ToUtcDateTimeOffset(timezone.Hours); + var beginUtc = request.Begin.Value.ToUniversalTime(); query = query.Where(m => m.DateTime >= beginUtc); } if (request.End is not null) { - var endUtc = request.End.Value.ToUtcDateTimeOffset(timezone.Hours); + var endUtc = request.End.Value.ToUniversalTime(); query = query.Where(m => m.DateTime <= endUtc); }