Files
ayrisdevandClaude Sonnet 5 ce9e01bbeb fix: panelde saatler 3 saat geri gösteriliyordu (sunucu UTC, Türkiye UTC+3)
.toLocaleString("tr-TR") tarih formatını Türkçe yapıyor ama saat değerini
hâlâ sunucunun sistem saat dilimiyle (Coolify/Hetzner container'ı UTC)
hesaplıyordu. Tüm tarih gösterimleri artık ortak formatTr() helper'ı
üzerinden timeZone: "Europe/Istanbul" ile sabitleniyor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 15:27:46 +03:00

11 lines
516 B
TypeScript

/**
* Server (Coolify/Hetzner) runs in UTC, but the panel is used from Turkey
* (UTC+3, no DST since 2016) — `.toLocaleString("tr-TR")` alone formats
* with tr-TR conventions but still uses the *server's* timezone for the
* actual time value, which was showing everything 3h behind. Always pin
* the timezone explicitly instead of relying on the runtime's default.
*/
export function formatTr(date: Date | string): string {
return new Date(date).toLocaleString("tr-TR", { timeZone: "Europe/Istanbul" });
}