Partager via


UTCToLocalTime Method

The UTCToLocalTime method of the SPTimeZone class converts the specified DateTime value from Coordinated Universal Time (UTC) to local time.

Parameters

date   A System.DateTime object that represents the UTC value to convert.

Return Value

A System.DateTime object that contains the date and time converted to their local values.

Example

The following code example displays the date and time on which each file in a Shared Documents document library was created and last modified, converting date and time values to local time.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint, Microsoft.SharePoint.Utilities, and Microsoft.SharePoint.WebControls namespaces.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security