T tg Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #1 ;我在编辑一个数据库程序时,经常要判断"今天星期几"! 请问哪位大侠有计算公式?
W www Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #2 试试这个 showmessage( formatdatetime('ddd',now));
F fatBaby Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #4 DayOfWeek 函数,Sorry, 前面说错了
Y y_zl Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #6 ; dayofweek is right ,notice 7 means Saturday,so you must translate result with switch_case structure
; dayofweek is right ,notice 7 means Saturday,so you must translate result with switch_case structure
W wind2000 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #9 function ToCnWeek(const CuDate: TDateTime): string; var w: integer; week: string; begin w := DayOfWeek(CuDate); case w of 1: week := '日'; 2: week := '一'; 3: week := '二'; 4: week := '三'; 5: week := '四'; 6: week := '五'; 7: week := '六'; end; {case} Result := '星期' + week; end;
function ToCnWeek(const CuDate: TDateTime): string; var w: integer; week: string; begin w := DayOfWeek(CuDate); case w of 1: week := '日'; 2: week := '一'; 3: week := '二'; 4: week := '三'; 5: week := '四'; 6: week := '五'; 7: week := '六'; end; {case} Result := '星期' + week; end;
J JohnsonGuo Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-27 #10 我来改进一下wind2000的程序。 function WeekDay(const CuDate: TDateTime): string; begin Result := '星期' + Copy('日一二三四五六', DayOfWeek(CuDate) * 2 + 1, 2); end;
我来改进一下wind2000的程序。 function WeekDay(const CuDate: TDateTime): string; begin Result := '星期' + Copy('日一二三四五六', DayOfWeek(CuDate) * 2 + 1, 2); end;
T tg Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-28 #11 我来改正一下johnsunguo的程序。 function WeekDay(const CuDate: TDateTime): string; begin Result := '星期' + Copy('日一二三四五六', DayOfWeek(CuDate) * 2 - 1, 2); end;
我来改正一下johnsunguo的程序。 function WeekDay(const CuDate: TDateTime): string; begin Result := '星期' + Copy('日一二三四五六', DayOfWeek(CuDate) * 2 - 1, 2); end;