[Delphi (Object Pascal)] Delphi得到时区偏差的代码 →→→→→进入此内容的聊天室

来自 , 2019-06-07, 写在 Delphi (Object Pascal), 查看 106 次.
URL http://www.code666.cn/view/0224cd59
  1. function AdjustedTimeZoneBias: Integer;
  2. var
  3.   TZI: Windows.TTimeZoneInformation;  // info about time zone
  4. begin
  5.   Result := 0;  // keeps compiler quiet
  6.   case Windows.GetTimeZoneInformation(TZI) of
  7.     Windows.TIME_ZONE_ID_INVALID: SysUtils.RaiseLastOSError;
  8.     Windows.TIME_ZONE_ID_STANDARD: Result := TZI.Bias + TZI.StandardBias;
  9.     Windows.TIME_ZONE_ID_DAYLIGHT: Result := TZI.Bias + TZI.DaylightBias;
  10.     Windows.TIME_ZONE_ID_UNKNOWN: Result := TZI.Bias;
  11.   end;
  12. end;
  13. //delphi/2158

回复 "Delphi得到时区偏差的代码"

这儿你可以回复上面这条便签

captcha