DayOfWeek 、WeekOf 是在 SysUtils 中,所以需要USES才能使用。
{DayOfWeek获取星期几}
showmessage('星期'+IntToStr(DayOfWeek(DateTimePicker1.DateTime)-1));
//showmessage('星期'+IntToStr(DayOfWeek(StrToDateTime('2019/04/20'))-1));
{WeekOf获取年度周期}
ShowMessage(IntToStr(WeekOf(StrToDateTime('2019/04/19'))));