Compartilhar via


LocalTimeToUTC Method

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

Parameters

date   A System.DateTime object that represents the local date and time value to convert.

Return Value

A System.DateTime object that contains the date converted to UTC.

Example

The following code example converts a date and time value to UTC and displays the converted value.

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

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security