В приложении .NET8 WebApi у меня есть этот метод:
Код: Выделить всё
private static string ProcessTimeZone(string timeZoneId)
{
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
var result = $"TimeZoneId = {timeZoneId}; DisplayName = {timeZoneInfo.DisplayName}; BaseUtcOffset = {timeZoneInfo.BaseUtcOffset}";
Console.WriteLine(result);
return result;
}
Код: Выделить всё
"TimeZoneId = Asia/Almaty; DisplayName = (UTC+05:00) East Kazakhstan Time (Almaty); BaseUtcOffset = 05:00:00"
Код: Выделить всё
"TimeZoneId = Asia/Almaty; DisplayName = (UTC+06:00) Bishkek; BaseUtcOffset = 06:00:00"
Подробнее здесь: https://stackoverflow.com/questions/798 ... nd-windows
Мобильная версия