function SynTimeFromServer(ServerDateTime: string;vmodify:Boolean = true): Boolean;
var
sysTime: TSystemTime;
begin
Result := True;
with sysTime do
begin
if vmodify then
wYear := 2015
else
wYear := StrToInt(LeftStr(ServerDateTime, 4));
wMonth := StrToInt(MidStr(ServerDateTime, 6, 2));
wDay := StrToInt(MidStr(ServerDateTime, 9,2));
wHour := StrToInt(MidStr(ServerDateTime, 12,2));
wMinute := StrToInt(MidStr(ServerDateTime, 15, 2));
wSecond := StrToInt(MidStr(ServerDateTime, 18,19));
wMilliseconds := 0;
end;
if not SetLocalTime(sysTime) then Result := False;
end;
var
sysTime: TSystemTime;
begin
Result := True;
with sysTime do
begin
if vmodify then
wYear := 2015
else
wYear := StrToInt(LeftStr(ServerDateTime, 4));
wMonth := StrToInt(MidStr(ServerDateTime, 6, 2));
wDay := StrToInt(MidStr(ServerDateTime, 9,2));
wHour := StrToInt(MidStr(ServerDateTime, 12,2));
wMinute := StrToInt(MidStr(ServerDateTime, 15, 2));
wSecond := StrToInt(MidStr(ServerDateTime, 18,19));
wMilliseconds := 0;
end;
if not SetLocalTime(sysTime) then Result := False;
end;