参考代码如下:
procedure TMainForm.BitBtn1Click(Sender: TObject);
var
lParam: Business.Model.TBizParam;
lStr: string;
lsyst: borland.Delphi.Windows.SYSTEMTIME;
lt : TDateTime;
y, m, d,h,min,sec,minsec: word;
begin
lParam := JUSTEPCOMMONUNIT.TJUSTEPCOMMONUNIT.GetParam(Self.Context,
'Biz:\SYSTEM\DataTimeParams.ParamGroup', 'ServerDateTime');
lt := Variants.Vartodatetime(lParam.Value);
Business.System.SysUtils.DecodeDate(lt,y,m,d);
Business.System.SysUtils.DecodeTime(lt,h,min,sec,minsec);
lsyst.wYear := y;
lsyst.wMonth := m;
lsyst.wDay := d;
lsyst.wHour := h;
lsyst.wMinute := min;
lsyst.wSecond := sec;
lsyst.wMilliseconds := minsec;
Borland.Delphi.Windows.SetLocalTime(lsyst) ;
end; |