PDA

View Full Version : Extract the year only from a qdate



emp1953
18th July 2017, 19:52
How do I get the year only out of a qdate query? A code snippet would be very helpful.

the reference to http://doc.qt.io/qt-5/qdatetime.html#toTime_t wasn't particularly helpful.

Thanks for any help

d_stranz
18th July 2017, 22:02
One would think that QDateTime::date() followed by QDate::year() could be easily found by reading further into the documentation at the link you posted.