Mono Class Library: System.DateTime Overview | Members

System.DateTime.ToLocalTime Method

Converts the universal time coordinate (UTC) time value in the current instance to local time. [Edit]

public DateTime ToLocalTime ()

Returns

An instance of DateTime equivalent of the time value in the current instance, adjusted to the local time zone and daylight saving time. If the result is too large or too small to be represented as a DateTime , this method returns a DateTime set to DateTime.MaxValue or DateTime.MinValue . [Edit]

Remarks

This method assumes that the current instance of DateTime holds the UTC time value, and not a local time. Each time it is invoked, this method performs the necessary modifications on the DateTime to derive the local time, whether the current DateTime holds the UTC time or not.

The local time zone information is obtained from the operating system.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0