判斷今天是周幾的Delphi函數是哪個啊?謝謝(50分)

  • 主题发起人 主题发起人 lixin38
  • 开始时间 开始时间
L

lixin38

Unregistered / Unconfirmed
GUEST, unregistred user!
判斷今天是周幾的Delphi函數是哪個啊?謝謝
 
function AGetWeek(const CuDate: TDateTime): string;<br>var<br> &nbsp;w: integer;<br> &nbsp;week: string;<br>begin<br> &nbsp;w := DayOfWeek(CuDate);<br> &nbsp;case w of<br> &nbsp; &nbsp;1: week := '日';<br> &nbsp; &nbsp;2: week := '一';<br> &nbsp; &nbsp;3: week := '二';<br> &nbsp; &nbsp;4: week := '三';<br> &nbsp; &nbsp;5: week := '四';<br> &nbsp; &nbsp;6: week := '五';<br> &nbsp; &nbsp;7: week := '六';<br> &nbsp;end; {case}<br> &nbsp;Result := '星期' + week;<br>end;
 
var<br> &nbsp;aYear,aWW,aDD:Word;<br>begin<br> &nbsp;DecodeDateWeek(Date,aYear,aWW,aDD);<br>其中aDD就是周幾,1...7對應周一到周日
 
DayOfWeek<br>不错,正是如此
 
多人接受答案了。
 

Similar threads

D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
800
import
I
I
回复
0
查看
794
import
I
后退
顶部