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. How to realize QDateTime::fromSecsSinceEpoch < Qt5.8 ?

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

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 532 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

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

    https://github.com/sonichy

    Gojir4G jsulmJ 2 Replies Last reply
    0
    • sonichyS sonichy

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

      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by
      #2

      @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);
      
      sonichyS 1 Reply Last reply
      3
      • sonichyS sonichy

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

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @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
        3
        • Gojir4G Gojir4

          @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);
          
          sonichyS Offline
          sonichyS Offline
          sonichy
          wrote on last edited by
          #4

          @Gojir4 Wonderful!

          https://github.com/sonichy

          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