Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Adding System Time and days lister

    QML and Qt Quick
    2
    2
    2001
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jr_jags last edited by

      Good day guys, how can i add the system time in my QML application and a command that shows the duration of days the user used the application?
      i want to show the days in a text Element

      1 Reply Last reply Reply Quote 0
      • M
        mlong last edited by

        Take a look at the javascript "Date":http://www.w3schools.com/jsref/jsref_obj_date.asp object.

        As for duration of days, you'll have to save (and restore) the date on the first use of your app and then do the calculation yourself later on. There are a number of "examples":http://www.javascriptkit.com/javatutors/datedifference.shtml on the web of how to do that.

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post