急急,各位高手,如何判断某一天所在的周,在某一年或某一月中是第几周?有这样的函数吗?请问如何在Delphi 中实现,谢谢大家了!

解决方案 »

  1.   

    DELPHI中好像没有直接的函数。
    SQL SERVER中: datepart(ww,getdate())
      

  2.   

    判断是星期几用:DayOfWeek(const DateTime: TDateTime): Word;
    判断是年的几周我记不清了,但是你可以在sysunils.pas中找。
      

  3.   

    delphi里有这样的函数function WeekOfTheMonth(const AValue: TDateTime): Word; overload;
    function WeekOfTheMonth(const AValue: TDateTime; var AYear, AMonth: Word): Word; overload;
    function WeekOf(const AValue: TDateTime): Word;
    function WeeksInAYear(const AYear: Word): Word;
    function WeeksInYear(const AValue: TDateTime): Word;
    自已看吧,怎么就是有些小朋友不喜欢看书呢
      

  4.   

    function WeekOfTheMonth(const AValue: TDateTime): Word; overload;
    function WeekOfTheMonth(const AValue: TDateTime; var AYear, AMonth: Word): Word; overload;
    function WeekOf(const AValue: TDateTime): Word;
    function WeeksInAYear(const AYear: Word): Word;
    function WeeksInYear(const AValue: TDateTime): Word;