Nominate our 2022 Qt Champions!

Time and Date

  • Hi all

    another seemingly simple problem but I have been reading around for ages and I cant seem to find a solution, currently trying (emphasis on word trying ) to build a touch screen gui , its my first attempt at anything on qt.

    I basically just want to add the current time and date to mainwindow.ui

    I am completely stuck i have read all sorts and i have confused myself



  • Lifetime Qt Champion


    Do you mean in the status bar for example ?

    In any case, you can use a QTimer triggered every second and QTime to get the current time to show on the status bar.

  • Lifetime Qt Champion

    Hi @DanJenk,

    not exactly what you want, but I have a very similar example on my github: StopWatch.

    Should be easy to transform to show the current date / time (hint: you can get that with QDateTime::currentDateTime().


Log in to reply