Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to convert fromMSecsSinceEpoch to date time format in qml
QtWS25 Last Chance

How to convert fromMSecsSinceEpoch to date time format in qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 2.6k Views
  • 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 Offline
    J Offline
    Jens van koolwijk
    wrote on last edited by
    #1

    How can i do this in Qml?

    QDateTime::fromMSecsSinceEpoch(timeStamp).toString("h:mm:ss:zz");

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean something like var date = new Date(milliseconds); ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • yuvaramY Offline
        yuvaramY Offline
        yuvaram
        wrote on last edited by
        #3

        In QML to get epochTime you can use,
        new Date().getTime().valueOf()

        Yuvaram Aligeti
        Embedded Qt Developer
        : )

        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