Files
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

17 lines
607 B
C#

using System;
namespace Pulsar.Client.Helper
{
public static class DateTimeHelper
{
public static string GetLocalTimeZone()
{
var tz = TimeZoneInfo.Local;
var tzOffset = tz.GetUtcOffset(DateTime.Now);
var tzOffsetSign = tzOffset >= TimeSpan.Zero ? "+" : "";
var tzName = tz.SupportsDaylightSavingTime && tz.IsDaylightSavingTime(DateTime.Now) ? tz.DaylightName : tz.StandardName;
return $"{tzName} (UTC {tzOffsetSign}{tzOffset.Hours}{(tzOffset.Minutes != 0 ? $":{Math.Abs(tzOffset.Minutes)}" : "")})";
}
}
}