I am using the find file dialog code at https://doc.qt.io/archives/qt-4.8/qt...s-example.html

I added the lines:
Qt Code:
  1. QDateTime fdate = QFileInfo(file).lastModified();
  2. QString sdate = fdate.toString("mm/dd/yyyy");
  3. qDebug() << sdate;
  4.  
  5. QTableWidgetItem *fileNameItem = new QTableWidgetItem(files[i]);
  6. fileNameItem->setFlags(fileNameItem->flags() ^ Qt::ItemIsEditable);
  7. QTableWidgetItem *sizeItem = new QTableWidgetItem(tr("")
  8. .arg(fdate.toString()));
To copy to clipboard, switch view to plain text mode 

QFileInfo(file).lastModified() gives the the following info:

Wed March 18 16:15:33 2020
Seems like kind of a jumbled way of providing a date time.

So I want just 03/18/2020 I feed it into QString sdate = fdate.toString("mm/dd/yyyy");
But this gives me "33/18/2020"

First How do I get the file info lastModified to appear as 03/18/2020?

Second I changed the declaration for sizeItem to:
QTableWidgetItem *sizeItem = new QTableWidgetItem(tr("")
.arg(fdate.toString()));

I want the date to be printed out instead of the file size. File size is useless to my needs.

How can I accomplish that part?

Thanks to all

emp1953