5,391
社区成员
发帖
与我相关
我的任务
分享
if IsSiteZONESupported then begin
if SendCmd('SITE ZONE') = 210 then begin {do not localize}
if LastCmdResult.Text.Count > 0 then begin
LBuf := LastCmdResult.Text[0];
// some servers (Serv-U, etc) use a 'UTC' offset string, ie
// "UTC-300", specifying the number of minutes from UTC. Other
// servers (Apache) use a GMT offset string instead, ie "-0300".
if TextStartsWith(LBuf, 'UTC-') then begin {do not localize}
FTZInfo.GMTOffset := MDTMOffset(Copy(LBuf, 4, MaxInt));
end else begin
FTZInfo.GMTOffset := GmtOffsetStrToDateTime(LBuf);
end;
FTZInfo.FGMTOffsetAvailable := True;
end;
end;
end;
function MDTMOffset(const AOffs : String) : TDateTime;
{$IFDEF USE_INLINE} inline; {$ENDIF}
var
LOffs : Integer;
begin
LOffs := IndyStrToInt(AOffs);
{We use ABS because EncodeTime will only accept positve values}
Result := EncodeTime(Abs(LOffs) div 60, Abs(LOffs) mod 60, 0, 0);
if LOffs > 0 then begin
Result := 0 - Result;
end;
end;