Display timestamps in Tehran time, not UTC
CI/CD / CI · dotnet build (push) Successful in 1m35s
CI/CD / Deploy · hamkadr (push) Successful in 3m1s

The server clock is correct (UTC); the app rendered UTC wall-clock directly, so
the run log showed ~3.5h behind Tehran. Add JalaliDate.ToTehran (flat UTC+3:30 —
Iran dropped DST in 2022) + DateTimeLabel, and convert the UTC-stored timestamp
displays (ingestion run log, RawListing FetchedAt, report CreatedAt). Shift
start/end inputs are TimeOnly, left as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-20 17:16:57 +03:30
parent fb7bfad9ce
commit 21befd5b1e
5 changed files with 16 additions and 4 deletions
@@ -25,6 +25,18 @@ public static class JalaliDate
private static readonly char[] PersianDigits = { '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' };
/// <summary>Convert a UTC timestamp (we store everything as <c>DateTime.UtcNow</c>) to Tehran
/// wall-clock. Iran is a fixed UTC+3:30 (DST abolished in 2022), so a flat offset is exact and
/// needs no timezone database.</summary>
public static DateTime ToTehran(DateTime utc) => utc.AddMinutes(210);
/// <summary>Jalali date + Tehran time, e.g. «۳۰ خرداد ۱۴۰۵ ۱۶:۲۱» — for UTC-stored timestamps.</summary>
public static string DateTimeLabel(DateTime utc)
{
var t = ToTehran(utc);
return ToLongDate(DateOnly.FromDateTime(t)) + " " + ToPersianDigits(t.ToString("HH:mm"));
}
/// <summary>Convert Latin digits in a string to Persian digits.</summary>
public static string ToPersianDigits(string input)
{