diff --git a/AsbCloudInfrastructure/Services/TelemetryTracker.cs b/AsbCloudInfrastructure/Services/TelemetryTracker.cs index b3d65769..801d687f 100644 --- a/AsbCloudInfrastructure/Services/TelemetryTracker.cs +++ b/AsbCloudInfrastructure/Services/TelemetryTracker.cs @@ -88,9 +88,15 @@ namespace AsbCloudInfrastructure.Services foreach (var oldReq in oldRequests) { var telemetryStat = telemetriesStats.GetOrAdd(oldReq.Uid, (uid) => new TrackerStat { RemoteUid = uid }); - telemetryStat.TelemetryDateMin = oldReq.DateMin; - telemetryStat.TelemetryDateMax = oldReq.DateMax; - telemetryStat.LastTimeServer = oldReq.DateMax; + var dateMin = oldReq.DateMin.Kind == DateTimeKind.Local + ? oldReq.DateMin.ToUniversalTime() + : oldReq.DateMin; + var dateMax = oldReq.DateMax.Kind == DateTimeKind.Local + ? oldReq.DateMax.ToUniversalTime() + : oldReq.DateMax; + telemetryStat.TelemetryDateMin = dateMin; + telemetryStat.TelemetryDateMax = dateMax; + telemetryStat.LastTimeServer = dateMax; } }).ContinueWith((t) => { @@ -123,7 +129,7 @@ namespace AsbCloudInfrastructure.Services stat.LastTimeServer = DateTime.Now; - if(stat.TelemetryDateMax < remoteDate) + if(stat.TelemetryDateMax.ToUniversalTime() < remoteDate.ToUniversalTime()) stat.TelemetryDateMax = remoteDate; }