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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get time of a file

Get time of a file

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • C Offline
    C Offline
    Cedric Moonen
    wrote on last edited by
    #1

    Hello all ! I want to know the time (hh:mm) of creation of a file (or at least the time of the last modification). Wich function can use for that ? Thanks

    A M C 3 Replies Last reply
    0
    • C Cedric Moonen

      Hello all ! I want to know the time (hh:mm) of creation of a file (or at least the time of the last modification). Wich function can use for that ? Thanks

      A Offline
      A Offline
      algol
      wrote on last edited by
      #2

      GetFileTime() API function or CFileFind::GetCreationTime(), GetLastWriteTime().

      1 Reply Last reply
      0
      • C Cedric Moonen

        Hello all ! I want to know the time (hh:mm) of creation of a file (or at least the time of the last modification). Wich function can use for that ? Thanks

        M Offline
        M Offline
        murali_utr
        wrote on last edited by
        #3

        Hi, use this CString CStrFileName; CStrFileName = "c:\\temp\test.exe"; FILETIME ftCreate, ftModify; CFileStatus m_FileStatus; CFile::GetStatus(CStrFileName,m_FileStatus); AfxTimeToFileTime(m_FileStatus.m_ctime, &ftCreate); AfxTimeToFileTime(m_FileStatus.m_mtime, &ftModify); Have A Nice Day Murali.M

        1 Reply Last reply
        0
        • C Cedric Moonen

          Hello all ! I want to know the time (hh:mm) of creation of a file (or at least the time of the last modification). Wich function can use for that ? Thanks

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Ok thanks everybody ! It is what I was searching for ;-)

          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