In the source code of our app we have got following line:
pcTimezone = System.TimeZoneInfo.Local.Id;
When I work locally on my office PC (Windows 10 in English, regional settings: English (USA)) everything is fine and pcTimezone
is set to "Central European Standard Time"
, but when I am connected from home by RDP System.TimeZoneInfo.Local.Id
returns
"Środkowoeuropejski Czas stand"
which is in Polish.
This leads to error
Time zone ID "Środkowoeuropejski Czas stand" was not found on the local computer
on line TimeZoneInfo.FindSystemTimeZoneById(pcTimezone)
I tried setting everything what I could to English on my home computer (system language is unchangeable so it is Polish still) and it did not help.
Is there any way to force value of System.TimeZoneInfo.Local
?
Or maybe you are able to set RDP not to override it from outer computer?