ConvertTimeFromUtc Method

TimeZoneInfo.ConvertTimeFromUtc Method

Converts a Coordinated Universal Time (UTC) to the time in a specified time zone.

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

Public Shared Function ConvertTimeFromUtc ( _
	dateTime As DateTime, _
	destinationTimeZone As TimeZoneInfo _
) As DateTime


Type: System.DateTime
The Coordinated Universal Time (UTC).
Type: System.TimeZoneInfo
The time zone to convert dateTime to.

Return Value

Type: System.DateTime
The date and time in the destination time zone. Its DateTime.Kind property is DateTimeKind.Utc if destinationTimeZone is TimeZoneInfo.Utc; otherwise, its DateTime.Kind property is DateTimeKind.Unspecified.


The Kind property of dateTime is DateTimeKind.Local.


destinationTimeZone is Nothing.

When performing the conversion, the ConvertTimeFromUtc method applies any adjustment rules in effect in the destinationTimeZone time zone.

The precise behavior of this method depends on the value of the Kind property of the dateTime parameter, as the following table shows.

DateTime.Kind property



Throws an ArgumentException.

DateTimeKind.Unspecified or DateTimeKind.Utc

Converts from Coordinated Universal Time (UTC).

If the conversion of dateTime results in a date and time value that is earlier than DateTime.MinValue or later than DateTime.MaxValue, this method returns DateTime.MinValue or DateTime.MaxValue, respectively.

Notes to Callers

On Windows XP systems, this method applies only the current adjustment rule to the time zone conversion if destinationTimeZone is TimeZoneInfo.Local. 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 converts Coordinated Universal Time (UTC) to Central Time.

Dim timeUtc As Date = Date.UtcNow
   Dim cstZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")
   Dim cstTime As Date = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone)
   Console.WriteLine("The date and time are {0} {1}.", _
                     cstTime, _
                     IIf(cstZone.IsDaylightSavingTime(cstTime), _
                         cstZone.DaylightName, cstZone.StandardName))
Catch e As TimeZoneNotFoundException
   Console.WriteLine("The registry does not define the Central Standard Time zone.")
Catch e As InvalidTimeZoneException
   Console.WriteLine("Registry data on the Central Standard Time zone has been corrupted.")
End Try

.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.

Community Additions

© 2015 Microsoft