From 131027c36c1a947a982406a365998a61261553cb Mon Sep 17 00:00:00 2001 From: alireza Date: Fri, 16 Oct 2026 10:34:15 +0330 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(telemetry):=20normalize=20ti?= =?UTF-8?q?mestamp=20kind=20-=20set=20server=20timestamp=20as=20UTC=20with?= =?UTF-8?q?=20unspecified=20kind=20-=20use=20unspecified=20kind=20for=20dt?= =?UTF-8?q?o=20before=20persian=20conversion=20-=20avoid=20timezone=20and?= =?UTF-8?q?=20kind=20issues=20in=20persian=20date=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Telemetry/TelemetryService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GreenHome.Infrastructure/Services/Telemetry/TelemetryService.cs b/src/GreenHome.Infrastructure/Services/Telemetry/TelemetryService.cs index f4ca91f..313e73e 100644 --- a/src/GreenHome.Infrastructure/Services/Telemetry/TelemetryService.cs +++ b/src/GreenHome.Infrastructure/Services/Telemetry/TelemetryService.cs @@ -38,11 +38,13 @@ public sealed class TelemetryService : ITelemetryService entity.DeviceId = device.Id; } - entity.ServerTimestampUtc = DateTime.Now; + entity.ServerTimestampUtc = DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Unspecified); if (dto.TimestampUtc.HasValue) { - var (year, month, day, persianDate) = dto.TimestampUtc.Value.ToPersianDate(); + var ts = DateTime.SpecifyKind(dto.TimestampUtc.Value, DateTimeKind.Unspecified); + entity.TimestampUtc = ts; + var (year, month, day, persianDate) = ts.ToPersianDate(); entity.PersianYear = year; entity.PersianMonth = month; entity.PersianDate = persianDate;