When I out put begin and end dates there not what I expect I just want the begin date variable to get current date with time set to zero (beginning of day)
I want the end date variable to get the current date with the time set to midnight basically (end of day)
but its not quit working
beginDate.
setTime(QTime(0,
0,
0,
0));
endDate.
setTime(QTime(23,
59,
59,
999));
qDebug() << "beginDate: " << beginDate; //not what I'm expecting to get
qDebug() << "endDate: " << endDate;
QSqlQuery selectQuery
("SELECT * FROM userlogevents WHERE dateTime BETWEEN ? and ?", m_selectDataBase
);
selectQuery.addBindValue(beginDate);
selectQuery.addBindValue(endDate);
QDateTime beginDate = QDateTime::currentDateTime();
beginDate.setTime(QTime(0,0,0,0));
QDateTime endDate = QDateTime::currentDateTime();
endDate.setTime(QTime(23,59,59,999));
qDebug() << "beginDate: " << beginDate; //not what I'm expecting to get
qDebug() << "endDate: " << endDate;
QSqlQuery selectQuery("SELECT * FROM userlogevents WHERE dateTime BETWEEN ? and ?", m_selectDataBase);
selectQuery.addBindValue(beginDate);
selectQuery.addBindValue(endDate);
To copy to clipboard, switch view to plain text mode
Bookmarks