How to get the time and date of rebuilding the program? Next you need to display it in the label widget. As I understood, I need to write something in the .pro file, but I have not found it yet. Any ideas?

  • 2
    No build date is written in the pro file. The build date is written in the MZPE header, but it is easily forged. - Vladimir Martyanov
  • Already found a way, used standard macros compiler GCC for Visual Studio they are the same. Used DATE to get compile date and TIME to get compile time. - Disastricks

1 answer 1

Here is my solution:

 ui->label->setText(trUtf8("Дата сборки программы: ") + __DATE__ + trUtf8(" в ") + __TIME__); 
  • 3
    __DATE__ / __TIME__ may show an incorrect value if the file in which they are used is not compiled at build time. - Vladimir Gamalyan