NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TimeZone.GetUTCOffset

Returns the coordinated universal time (UTC) offset in ticks, at the specified time.

[Visual Basic]
Overridable Public Function GetUTCOffset( _
   ByVal time As DateTime _
) As Long
[C#]
public virtual long GetUTCOffset(
   DateTime time
);
[C++]
public: virtual __int64 GetUTCOffset(
   DateTime time
);
[JScript]
public function GetUTCOffset(
   time : DateTime
) : long;

Parameters

time
The time specified.

Return Value

The coordinated universal time (UTC) offset in ticks, at the time specified.

Remarks

If the specified time is in the daylight saving time, the returned offset will be the UTC offset of the daylight saving time. This is the offset to add to UTC to get local time. That is:

local time = UTC + offset

For example, US Pacific Standard timezone, which has a-8 hours of offset, GetUTCOffset(new DateTime(1999, 1, 1)) will has the value-288000000000. The specified time should be in Gregorian calendar.

NOTE: Currently, this method only supports the time zone rule of the current year. The information is from the system. It assumes that every year has the same daylight saving rule.

See Also

TimeZone Class | TimeZone Members | System Namespace