Snippet program code. Task Get the number of milliseconds in the current minute of the day. Used operator remainder of division.
- #include <QCoreApplication>
- #include <QTime>
- #include <QDebug>
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- QTime time = QTime::currentTime();
- qDebug() << time.msecsSinceStartOfDay() % 60000;
- return a.exec();
- }
а почему делитель 60000, а не 1000?
Потому, что в минуте 60 секунд