Languages
[Edit]
EN

C# / .NET - current time zone offset

13 points
Created by:
Theodora-Battle
528

In C# / .NET it is possible to get time zone with TimeZoneInfo class.

1. TimeZoneInfo class example

Edit

Output:

Notes:
  • Example has been run from London in United Kingdom.
  • Do not use TimeZone class because is obsolete.
  • TimeZoneInfo.BaseUtcOffset property returns difference between current time and UTC.

References

Edit
  1. TimeZoneInfo Class - Microsoft Docs
  2. Coordinated Universal Time (UTC) - Wikipedia

Merged questions

Edit
  • C# / .NET - get current timezone
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join