31 lines
794 B
Plaintext
31 lines
794 B
Plaintext
include::../description-dotnet.adoc[]
|
|
|
|
include::../why-dotnet.adoc[]
|
|
|
|
include::../how-dotnet.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,csharp,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.
|
|
var ianaTimeZone = "Asia/Tokyo";
|
|
var windowsTimeZone = TZConvert.IanaToWindows(ianaTimeZone);
|
|
TimeZoneInfo tokyoWindowsTimeZone = TimeZoneInfo.FindSystemTimeZoneById(windowsTimeZone);
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,csharp,diff-id=1,diff-type=compliant]
|
|
----
|
|
// Assuming we are in Windows OS and we need to get the Tokyo Time Zone.
|
|
var ianaTimeZone = "Asia/Tokyo";
|
|
TimeZoneInfo tokyoWindowsTimeZone = TimeZoneInfo.FindSystemTimeZoneById(ianaTimeZone);
|
|
----
|
|
|
|
== Resources
|
|
|
|
include::../resources-dotnet.adoc[]
|