DateTimeExtensionsAsLocal Method

Converts the specified dateTime to a local time. Unlike DateTime.ToLocalTime, this method does not treat DateTime instances with Unspecified Kind as UTC times.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.0.0-rc.1
C#
public static DateTime AsLocal(
	this DateTime dateTime
)

Parameters

dateTime  DateTime
The DateTime to convert.

Return Value

DateTime
A DateTime instance with Local Kind.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also