include::../introduction-dotnet.adoc[]

include::../why-dotnet.adoc[]

include::../how-dotnet.adoc[]

=== Code examples

==== Noncompliant code example

[source,vbnet,diff-id=1,diff-type=noncompliant]
----
Dim myDate As DateTime = New DateTime(2008, 6, 19, 7, 0, 0, DateTimeKind.Local) ' Noncompliant

Dim now = DateTime.Now ' Noncompliant
----

==== Compliant solution

[source,vbnet,diff-id=1,diff-type=compliant]
----
Dim myDate As DateTimeOffset = New DateTimeOffset(2008, 6, 19, 7, 0, 0, TimeSpan.FromHours(-7)) ' Compliant

Dim now = DateTimeOffset.Now ' Compliant
----

include::../pitfalls-dotnet.adoc[]

include::../resources-dotnet.adoc[]