Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. get date stamp on current running exe

get date stamp on current running exe

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 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.
  • R Offline
    R Offline
    rayjoslyn
    wrote on last edited by
    #1

    How can I get the date stamp of my running executable? Ray

    R J 2 Replies Last reply
    0
    • R rayjoslyn

      How can I get the date stamp of my running executable? Ray

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2
      1. GetModuleFilename()
      2. CFile::GetStatus()
      3. Examine the m_ctime member

      /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      1 Reply Last reply
      0
      • R rayjoslyn

        How can I get the date stamp of my running executable? Ray

        J Offline
        J Offline
        Jesse Evans
        wrote on last edited by
        #3

        I use the date stamp of my executable as the version number, which I append to the title of my main window. Here's how I get the info: // the version number of the app is the concatenation of the file's // date and time values: // yyyy.mm.dd.hh.mm static char appVersion[30]; void AteUtility_InitAppVersion (HINSTANCE hInstance) { char szFileName[MAX_PATH]; char szFileTitle[MAX_PATH]; WIN32_FIND_DATA fileData; FILETIME localModTime; SYSTEMTIME systemTime; GetModuleFileName (hInstance, szFileName, MAX_PATH); GetFileTitle (szFileName, szFileTitle, MAX_PATH); FindFirstFile (szFileName, &fileData); FileTimeToLocalFileTime (&fileData.ftLastWriteTime, &localModTime); FileTimeToSystemTime (&localModTime, &systemTime); sprintf(appVersion, "Version: %4.4d.%2.2d.%2.2d.%2.2d.%2.2d", systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute); } Hope this helps! ;) 'til next we type... HAVE FUN!! -- Jesse

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups