Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Conversion of date time string to milliseconds and vice versa
Qt 6.11 is out! See what's new in the release blog

Conversion of date time string to milliseconds and vice versa

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 11.5k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    aekam
    wrote on last edited by
    #1

    Hello,
    I need to convert date time string [which i can construct in suitable format, if required] to milliseconds [since epoch time] and vice versa in QML/JS.
    Is there any API available for this.???

    another doubt I have, is there any different between QML's 'property date' type and JavaScripts's 'Date' object.???

    If you take care of inches, you won't have to worry about miles... :)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      I don't know if there is such functionality in QML directly, but in any way you can export custom function to the QML space and use it for format conversion... Take a look at "Extending QML Functionalities using C++"http://doc.qt.digia.com/qt/qtbinding.html and "Using QML Bindings in C++ Applications":http://doc.qt.digia.com/qt/qtbinding.html

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        broadpeak
        wrote on last edited by
        #3

        This can help?:
        http://www.epochconverter.com/programming/#javascript

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aekam
          wrote on last edited by
          #4

          Thank you all for reply...
          I would like to know about all the possible date string formats supported by 'Date object' while creating like this, var myDate = new Date (dateString). couldn't get well document anywhere...

          If you take care of inches, you won't have to worry about miles... :)

          1 Reply Last reply
          0
          • B Offline
            B Offline
            broadpeak
            wrote on last edited by
            #5

            http://javascript.info/tutorial/datetime-functions
            http://www.w3schools.com/jsref/jsref_obj_date.asp
            and
            http://blog.stevenlevithan.com/archives/date-time-format

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved