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. [SOLVED] Build Date - Mac OSX
QtWS25 Last Chance

[SOLVED] Build Date - Mac OSX

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • M Offline
    M Offline
    maximus
    wrote on last edited by
    #1

    Hi,

    When I build my project, I set a variable so I get the current Date and Time (will be show in the "About my app" Dialog)

    On Windows, I use this:
    @#DEFINES += BUILDDATE=(DATE)
    #DEFINES += BUILDTIME=(TIME)@

    Works fine for Windows, but on MacOSX, i'd like to get the BuildDate and time also, but the code above is not working, is there any solution to do this on Mac also? Thanks!


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      DATE and TIME macros are defined in ISO C standard, they are supported by all compilers. It should work on Mac OS. However, I think you are trying to use them in the .pro file, right?

      An important thing is to remember that those macros are invoked at compilation time of a given file, not at linking time of the whole application. So if you are not doing a clean reabuild, you might end up with an older date.

      (Z(:^

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maximus
        wrote on last edited by
        #3

        Hey sierdzio thanks for your reply,

        Yes I was trying to use them in the .pro file.
        On OS X it was weirdly giving error into another object "[Audio.h] Error 2" - at compile time when theses 2 lines are not commented.

        I'm also thinking just using a Global QString that I will update on major new version manually. that way it can have a uniform format, because (DATE) use the english date.
        i.e:
        BUILDATE = "20/09/2014"

        Thank you!


        Free Indoor Cycling Software - https://maximumtrainer.com

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maximus
          wrote on last edited by
          #4

          Solved

          @//have to edit every new release
          const static QString date_released = "26/11/2014";@


          Free Indoor Cycling Software - https://maximumtrainer.com

          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