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>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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" });
|
||||
}
|
||||
Reference in New Issue
Block a user