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.


Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.2.0
public static DateTime AsLocal(
	this DateTime dateTime


dateTime  DateTime
The DateTime to convert.

Return Value

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