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. FILETIME / WinAPI

FILETIME / WinAPI

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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.
  • F Offline
    F Offline
    Fareed Rizkalla
    wrote on last edited by
    #1

    I understand the FILETIME structure and how data is stored. However I called a Filename's attributes and retrieved the time/date attributed to it. Then calling FileTimeToLocalFileTime function converts from UTC to LocalTime. However I'm seeing a weird anomaly, it appeared to occur on the 24 hour conversion. Time during the day (AM) was missing an hour, but on special folders by located for Windows. Even files located in the root I created during the day were correctly timed? :doh:

    V D 2 Replies Last reply
    0
    • F Fareed Rizkalla

      I understand the FILETIME structure and how data is stored. However I called a Filename's attributes and retrieved the time/date attributed to it. Then calling FileTimeToLocalFileTime function converts from UTC to LocalTime. However I'm seeing a weird anomaly, it appeared to occur on the 24 hour conversion. Time during the day (AM) was missing an hour, but on special folders by located for Windows. Even files located in the root I created during the day were correctly timed? :doh:

      V Offline
      V Offline
      vasu_sri
      wrote on last edited by
      #2

      if you have FILETIME structure, then use this function FileTimeToSystemTime(); in this function pass the SYSTEMTIME as sencond argument. like this: FileTimeToSystemTime(&fileTime,&systemTime); szString.Format (_TEXT("%02d-%02d-%d"),systemTime.wMonth,systemTime.wDay,systemTime.wYear);

      Regards, Srinivas

      F 1 Reply Last reply
      0
      • V vasu_sri

        if you have FILETIME structure, then use this function FileTimeToSystemTime(); in this function pass the SYSTEMTIME as sencond argument. like this: FileTimeToSystemTime(&fileTime,&systemTime); szString.Format (_TEXT("%02d-%02d-%d"),systemTime.wMonth,systemTime.wDay,systemTime.wYear);

        Regards, Srinivas

        F Offline
        F Offline
        Fareed Rizkalla
        wrote on last edited by
        #3

        You haven't read my problem, maybe took a good look than a glimpse at it! FileDetails is Structure used in FindFile function.

        FILETIME UTCTime = FileDetails.ftCreationTime;
        FILETIME LocalTime;

        FileTimeToLocalFileTime( &UTCTime, &LocalTime);

        SYSTEMTIME HumanReadableForm;
        FileTimeToSystemTime(&LocalTime, &HumanReadableForm);

        1 Reply Last reply
        0
        • F Fareed Rizkalla

          I understand the FILETIME structure and how data is stored. However I called a Filename's attributes and retrieved the time/date attributed to it. Then calling FileTimeToLocalFileTime function converts from UTC to LocalTime. However I'm seeing a weird anomaly, it appeared to occur on the 24 hour conversion. Time during the day (AM) was missing an hour, but on special folders by located for Windows. Even files located in the root I created during the day were correctly timed? :doh:

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Fareed Rizkalla wrote:

          Time during the day (AM) was missing an hour...

          :confused: This makes no sense. Please explain.

          Fareed Rizkalla wrote:

          Even files located in the root I created during the day were correctly timed?

          Are you asking or telling?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          F 1 Reply Last reply
          0
          • D David Crow

            Fareed Rizkalla wrote:

            Time during the day (AM) was missing an hour...

            :confused: This makes no sense. Please explain.

            Fareed Rizkalla wrote:

            Even files located in the root I created during the day were correctly timed?

            Are you asking or telling?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            F Offline
            F Offline
            Fareed Rizkalla
            wrote on last edited by
            #5

            I'm telling my problem, and asking for a possible cause! If you don't have AM/PM in a time format you assumed it's using the 24 hour format. I was mapping files on my drive, when I suddenly found a deviation between the time listed in Explorer and my output. It seemed to occur randomly and it was related to time during AM and only files related to the OS, not the files which I had created which were also during the same period AM. Is this clearer?

            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