Estou tentando criar um fuso horário sintético GMT + 20 no Windows 10 (para testar nosso software para cenários extremos de diferença TZ cliente-servidor):
$standardDisplayName = "(GMT+20:00) Synthetic 20"
$standardName = "My Time"
$baseUtcOffset = New-TimeSpan -Hours 20
$daylightDisplayName=[string]::Empty
$adjustmentRules=$null
$disableDaylightSavingTime=$false
$newTZ = [TimeZoneInfo]::CreateCustomTimeZone($standardName, $baseUtcOffset, $standardDisplayName, $standardName,$daylightDisplayName,$adjustmentRules,$disableDaylightSavingTime)
E eu estou ficando
"The TimeSpan parameter must be within plus or minus 14.0 hours."
Existe alguma maneira de contornar isso?
É impossível com o método .NET TimeZoneInfo.CreateCustomTimeZone , pois a propriedade BaseUtcOffset deve ter valor entre 14 e -14.
Prove: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.baseutcoffset?view=net-5.0