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;
The coordinated universal time (UTC) offset in ticks, at the time specified.
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.