uses ComObj, DateUtils;

procedure TForm1.Button1Click(Sender: TObject);
var
XmlHttp: Variant;
datetxt : String;
DateLst : TStringList;
mon: String;
timeGMT,GetNetTime:TDateTime;
begin
XmlHttp := CreateOleObject('Microsoft.XMLHTTP');
XmlHttp.Open( 'Get', 'http://www.baidu.com/', False);
XmlHttp.send;
datetxt :=XmlHttp.getResponseHeader('Date');
datetxt := Copy(datetxt,Pos(',',datetxt)+,);
datetxt := StringReplace(datetxt,'GMT','',[]);
datetxt := Trim(datetxt);
DateLst := TStringList.Create;
while Pos(' ',datetxt)> do
begin
DateLst.Add(Copy(datetxt,,Pos(' ',datetxt)-)) ;
datetxt := Copy(datetxt,Pos(' ',datetxt)+,);
end ;
DateLst.Add(datetxt) ;
if DateLst[] = 'Jan' then
mon := ''
else if DateLst[] = 'Feb' then
mon := ''
else if DateLst[] = 'Mar' then
mon := ''
else if DateLst[] = 'Apr' then
mon := ''
else if DateLst[] = 'Mar' then
mon := ''
else if DateLst[] = 'Jun' then
mon := ''
else if DateLst[] = 'Jul' then
mon := ''
else if DateLst[] = 'Aug' then
mon := ''
else if DateLst[] = 'Sep' then
mon := ''
else if DateLst[] = 'Oct' then
mon := ''
else if DateLst[] = 'Nov' then
mon := ''
else if DateLst[] = 'Dec' then
mon := '' ;
timeGMT := StrToDateTime(DateLst[]+'-'+mon+'-'+DateLst[]+' '+ DateLst[]);
GetNetTime := IncHour(TimeGMT,);
self.Caption := FormatDateTime('yyyy年mm月dd日 HH:NN:SS',GetNetTime) ;
end;

http://www.lsworks.net/article/20.html

04-13 15:16