FILETIME / WinAPI
-
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:
-
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:
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
-
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
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); -
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:
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
-
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
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?