This documentation is archived and is not being maintained.

TimeZoneInfo.ConvertTimeToUtc Method (DateTime)

Converts the current date and time to Coordinated Universal Time (UTC).

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

static member ConvertTimeToUtc : 
        dateTime:DateTime -> DateTime 


Type: System.DateTime
The date and time to convert.

Return Value

Type: System.DateTime
The Coordinated Universal Time (UTC) that corresponds to the dateTime parameter. The DateTime value's Kind property is always set to DateTimeKind.Utc.


TimeZoneInfo.Local.IsInvalidDateTime(dateTime) returns true.

The exact conversion performed depends on the value of the Kind property of the dateTime parameter, as the following table shows.

DateTime.Kind property



Converts from local time to Coordinated Universal Time (UTC).


Assumes dateTime is local time and converts from local time to UTC.


Returns dateTime unchanged.

If dateTime corresponds to an ambiguous local time, this method assumes that it is standard local time. If dateTime corresponds to an invalid local time, the method throws an ArgumentException.


If the current computer's local time zone includes multiple adjustment rules, this overload of the ConvertTimeToUtc method can return results that differ from the TimeZone.ToUniversalTime and DateTime.ToUniversalTime methods

If the UTC equivalent of dateTime is earlier than DateTime.MinValue or later that DateTime.MaxValue, this method returns MinValue or MaxValue, respectively.

Notes to Callers

On Windows XP systems, this method applies only the current adjustment rule to the time zone conversion. As a result, the method may not accurately convert times for periods before the current adjustment rule came into effect. For more information, see the Notes for Callers section in the Local property.

The following example illustrates the conversion of time values whose Kind property is DateTimeKind.Utc, DateTimeKind.Local, and DateTimeKind.Unspecified, respectively. It also illustrates the conversion of ambiguous and invalid times.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.