1、USER :DateUtils 2、使用 StartOfTheMonth 和 EndOfTheMonth 函数获取即可; procedure TForm1.btn1Click(Sender: TObject); begin mmo1.Lines.Add(FormatDateTime('yyyy-mm-dd',StartOfTheMonth(Now))); mmo1.Lines.Add(FormatDateTime('yyyy-mm-dd',EndOfTheMonth(Now))); //mmo1.Lines.Add(DateTimeToStr(StartOfTheMonth(Now))); //mmo1.Lines.Add(DateTimeToStr(EndOfTheMonth(Now))); end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论