diff options
| author | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-02-18 12:08:03 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-02-18 12:08:03 +0000 |
| commit | 6aa9d8d318d1540caac8becaabfe0ef95ff96b17 (patch) | |
| tree | 45257e6c4bbfd515e3fe073966257b183348e0db /src/Enmarcha.Backend/Services | |
| parent | 5019b02ff445f9e75c2a5d92df2da2f037a01781 (diff) | |
Fix UTC timestamp parsing issue in CtagShuttle causing 60-minute offsetcopilot/fix-timestamp-utc-issue
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
Diffstat (limited to 'src/Enmarcha.Backend/Services')
| -rw-r--r-- | src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs index 593ac86..570059b 100644 --- a/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs +++ b/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs @@ -42,7 +42,10 @@ public class CtagShuttleRealTimeProcessor : AbstractRealTimeProcessor System.Diagnostics.Activity.Current?.SetTag("shuttle.status", status.StatusValue); // Validate position timestamp - skip if data is stale (>3 minutes old) - var positionAge = (context.NowLocal - status.LastPositionAt).TotalMinutes; + // Convert UTC timestamp to Madrid time for comparison + var madridTz = TimeZoneInfo.FindSystemTimeZoneById("Europe/Madrid"); + var lastPositionMadrid = TimeZoneInfo.ConvertTimeFromUtc(status.LastPositionAt, madridTz); + var positionAge = (context.NowLocal - lastPositionMadrid).TotalMinutes; if (positionAge > MaxPositionAgeMinutes) { _logger.LogInformation( |
