The most consistent API for this is TimeZoneInfo.Local.Id which has also been around for a while so no need for #ifdef
On CoreCLR, Linux and macOS, it'll return the 'Europe/Vienna' format.
On CoreCLR and CLR on Windows, it'll return the 'W. Europe Daylight Time' format.
For Mono and Linux under WSL, see:
mono/mono/issues/8267
Microsoft/WSL/issues/3109
As part of the Contexts interface, provide the TimeZone information with each event.
Sentry docs on the Context Interface: https://docs.sentry.io/clientdev/interfaces/contexts/
The most consistent API for this is
TimeZoneInfo.Local.Id
which has also been around for a while so no need for #ifdefOn CoreCLR, Linux and macOS, it'll return the 'Europe/Vienna' format. On CoreCLR and CLR on Windows, it'll return the 'W. Europe Daylight Time' format.
For Mono and Linux under WSL, see: mono/mono/issues/8267 Microsoft/WSL/issues/3109