获取星期几

type
  TForm1 = class(TForm)
    edt1: TEdit;
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
    function getWeek:string;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function Tform1.getWeek:string;

var
  date:SYSTEMTIME;
begin
  GetLocalTime(date);
  case date.wDayOfWeek of
    0:Result:='星期天';
    1:Result:='星期一';
    2:Result:='星期二';
    3:Result:='星期三';
    4:Result:='星期四';
    5:Result:='星期五';
    6:Result:='星期六';
  end;
end;

posted @ 2012-04-11 22:50  Unique.Y  阅读(167)  评论(0编辑  收藏  举报