码迷,mamicode.com
首页 > 其他好文 > 详细

RFC822DateGMT

时间:2014-12-18 18:36:46      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   ar   io   color   sp   for   on   

function RFC822DateGMT(dd: TDateTime): string;
const
  Days:array [1..7] of string=
    (Sun,Mon,Tue,Wed,Thu,Fri,Sat);
  Months:array [1..12] of string=
    (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
//  SignStr:array[boolean] of string=(‘-‘,‘+‘);
var
  dg:TDateTime;
  y,m,d,wd,th,tm,ts,tms:Word;
  tz:TIME_ZONE_INFORMATION;
begin
  GetTimeZoneInformation(tz);
  dg:=dd+tz.Bias/1440;
  DecodeDateFully(dg,y,m,d,wd);
  DecodeTime(dg,th,tm,ts,tms);
  FmtStr(Result, %s, %d %s %d %.2d:%.2d:%.2d GMT,
    [Days[wd],d,Months[m],y,th,tm,ts]);
end;

本文转自:

http://sourceforge.net/p/xxm/code/HEAD/tree/trunk/Delphi/common/xxmCommonUtils.pas

RFC822DateGMT

标签:style   blog   http   ar   io   color   sp   for   on   

原文地址:http://www.cnblogs.com/starluck/p/4172315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!