如何把时间转换成星期
本人是刚学Delphi的怎么才能把“时间转换成星期”
希望能详细讲一下
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls,typinfo;
type
weekday=(sunday,monday,tuesday,wednsesday,thursday,friday,saturdat);
cc=set of char;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
DateTimePicker1: TDateTimePicker;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
d:weekday;
p:pointer;
begin
d:=sunday;
p:=TypeInfo(weekday);
edit1.Text:=getenumname(p,dayofweek(datetimepicker1.Date)-1);
end;
end.