Qt Forum

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

    Solved How to realize QDateTime::fromSecsSinceEpoch < Qt5.8 ?

    General and Desktop
    3
    4
    176
    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.
    • sonichy
      sonichy last edited by

      QDateTime::fromSecsSinceEpoch was introduced in Qt 5.8.
      How to realize it when Qt < 5.8 ?

      https://github.com/sonichy

      Gojir4 jsulm 2 Replies Last reply Reply Quote 0
      • Gojir4
        Gojir4 @sonichy last edited by

        @sonichy Hi,

        You can probably use QDateTime::fromMSecsSinceEpoch() which is available from Qt 4.7. (or Qt 5.2 for overloaded ones)

        QDateTime::fromMSecsSinceEpoch(seconds * 1000);
        
        sonichy 1 Reply Last reply Reply Quote 3
        • jsulm
          jsulm Lifetime Qt Champion @sonichy last edited by

          @sonichy said in How to realize QDateTime::fromSecsSinceEpoch < Qt5.8 ?:

          How to realize it when Qt < 5.8 ?

          You can take a look at its implementation in Qt source code >= 5.8

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply Reply Quote 3
          • sonichy
            sonichy @Gojir4 last edited by

            @Gojir4 Wonderful!

            https://github.com/sonichy

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