参考一下吧,
procedure TfrmMain.SetStandardTimeZone;
var
ZI : TTimeZoneInformation;
S : WideString;
I : Integer;
begin
//设置当前时区为 中国标准时间
GetTimeZoneInformation(ZI);
if (ZI.Bias <> -480) or (ZI.StandardName <> WideString('中国标准时间')) then
begin
FillChar(ZI, SizeOf(ZI), 0);
ZI.Bias := -480; //GMT+08:00
ZI.StandardBias := 0;
ZI.DaylightBias := -60;
S := WideString('中国标准时间');
for I := 1 to Length(S) do
begin
ZI.StandardName[I-1] := S;
end;
S := WideString('中国夏时制时间');
for I := 1 to Length(S) do
begin
ZI.DaylightName[I-1] := S;
end;
SetTimeZoneInformation(ZI);
end;
end;