Return Value

A DateTime object whose Kind property is Utc, and whose value is the UTC equivalent to the value of the current DateTime object, or MaxValue if the converted value is too large to be represented by a DateTime object, or MinValue if the converted value is too small to be represented by a DateTime object.

The UTC time is equal to the local time minus the UTC offset. For more information about the UTC offset, see TimeZone.GetUtcOffset. The conversion also takes into account the daylight saving time rule that applies to the time represented by the current DateTime object.

Starting with the .NET Framework version 2.0, the value returned by the ToUniversalTime method is determined by the Kind property of the current DateTime object. The following table describes the possible results.

The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local.

The value returned by this conversion is a DateTime object whose Kind property is Utc. Consequently, a valid result is returned even if ToUniversalTime is applied repeatedly to the same DateTime object.