Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the Coordinated Universal Time (UTC) offset for the specified local time.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public MustOverride Function GetUtcOffset ( _
time As DateTime _
) As TimeSpan
public abstract TimeSpan GetUtcOffset(
DateTime time
)
public:
virtual TimeSpan GetUtcOffset(
DateTime time
) abstract
abstract GetUtcOffset :
time:DateTime -> TimeSpan
public abstract function GetUtcOffset(
time : DateTime
) : TimeSpan
Parameters
- time
Type: System. . :: . .DateTime
A date and time value.
Return Value
Type: System. . :: . .TimeSpan
The Coordinated Universal Time (UTC) offset from time.
Remarks
This method returns the offset, or difference, between the time parameter and Coordinated Universal Time (UTC). That is:
time = UTC + offset
The method interprets the time zone of time based on its Kind property. If the value of the Kind property is DateTimeKind..::..Local or DateTimeKind.Unspecified, the method returns the offset of the local time zone. If the value of the Kind property is DateTimeKind..::..Utc, the method returns an offset equal to TimeSpan..::..Zero.
If the local time zone observes daylight saving time, GetUtcOffset applies the current adjustment rule to time when determining the offset of the local time zone. That is, the offset returned by GetUtcOffset reflects whether time falls in the time zone's standard time or its daylight saving time.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.