This document is provided on an "AS IS" basis without warranties of any kind. Smartsite iXperion class libraries may change in future releases.
Converts the value of the given DateTime object to local time.

Namespace: Smartsite.Runtime.Modules
Assembly:  Smartsite.Runtime.Modules (in Smartsite.Runtime.Modules.dll)

Syntax

C#Copy imageCopy Code
[(IsDeterministic = true)]
public static <> ToLocalTime(
	 dt
)
Visual Basic (Declaration)Copy imageCopy Code
<(IsDeterministic := True)> _
Public Shared Function ToLocalTime ( _
	dt As  _
) As (Of )

Parameters

dt
DateTime
A DateTime.

Return Value

A DateTime based on local time, whose value is the local time equivalent to the value of the given DateTime, or DateTime.MaxValue if the converted value is too large to be represented by a DateTime, or DateTime.MaxValue if the converted value is too small to be represented by a DateTime.

Remarks

The local time is equal to the UTC time plus the UTC offset. The conversion also takes into account the daylight saving time rule that applies to the time represented by the current DateTime object. The value returned by the conversion is a DateTime based on the local time zone. Consequently, a valid result is returned even if ToLocalTime is applied repeatedly to the same DateTime. This method always uses the local time zone when making calculations.

See Also

Advanced