那位同志又算法么?谢谢。

解决方案 »

  1.   

    function DayOfWeek(Date: TDateTime): Integer;DescriptionDayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.
      

  2.   

    windows api的GETLOCALTIME就可以实现,具体参数你查一下连机帮助!
      

  3.   

    结合SQLSERVER,SQLSERVER中有函数 datepart(weekday,getdate())。 
      

  4.   

    可以用
    function dayofweek(date:tdatetime):integer;
    这个函数
    例:取今天的星期天
    var
    today1:integer;
    today1:=dayofweek(date);
    用DAYOFWEEK取出的数为整数(1、2、3、4、5、6、7)对应的星期为(日、一、二、三、四、五、六—)这样再写上相应的语句就可以了
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Edit1.Text:=vartostr(weekoftheyear(DateTimePicker1.date));
    end;
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Edit1.Text:=vartostr(weekoftheyear(DateTimePicker1.date));
    end;
    顺便说一下,要引用Dateutils单元.
      

  7.   

    uses DateUtils
    用DayOfTheWeek直接返回星期几,如果用DayOfWeek是返回一周的第几天(从周日开始算1)