c++ - How to Read current Time in QTimeEdit in Qt? -


how read current hour , minute set user in qtimeedit in qt, , how in qdatetime (read current day, month, year, minute , hour)?

use time() , date() methods:

const int hour   = timeedit->time().hour(); const int minute = timeedit->time().minute(); const int day    = dateedit->date().day(); const int month  = dateedit->date().month(); const int year   = dateedit->date().year(); 

Comments