forked from ddrilling/AsbCloudServer
Fix dateTime bug
This commit is contained in:
parent
889a8a8757
commit
24c0ba5e16
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user