从一个日期里提取月份,数据库是delphi自带的paradox,有什么函数可用吗
例如从DateTimePicker2.Date里提取month
DateTimePicker2.Date (注:’2002/3/23‘)
另外incmonth(DateTimePicker2.Date,3)返回值是不是’’2002/2/23‘???
例如从DateTimePicker2.Date里提取month
DateTimePicker2.Date (注:’2002/3/23‘)
另外incmonth(DateTimePicker2.Date,3)返回值是不是’’2002/2/23‘???
wyear,wmonth,wday:word;
begin
DecodeDate(DateTimePicker2.Date,wyear,wmonth,wday);
end;wmonth就是你要的月份
Present: TDateTime;
Year, Month, Day: Word;
begin
Present:= DateTimePicker2.Date;
DecodeDate(Present, Year, Month, Day);
Label1.Caption :=IntToStr(Month);
end;