converting time (C / C++) - 01/08/03 11:03 PM
I'm actually expanding some things in my dll and want to convert the size of an file listing (findfirst + findnext).
I get an FILETIME struct (from MSDN: "The FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).") from WIN32_FIND_DATA containing the times (one for creation, one for last access, one for last modified) and want to convert it to a format mIRC can handle (time_t i think, like the return of $ctime in mIRC), so it can be formatted with $asctime() by mirc or the asctime() function of my dll. (asctime is defined in time.h i think).
My problem is, that i tried to convert it, but nearly all values were wrong. Even a converting by a given function like FileTimeToSystemTime() is incorrect. (although the difference seems to be constante 2 hours, maybe something with timezones?)
Does anyone know how to convert the size correctly? (with code would be nice )
I tried to "turn around" MSDN example , this returned sometimes a nearly correct time (3 secs more or less than mIRC), but sometimes one day and 3 secs more / less.
I get an FILETIME struct (from MSDN: "The FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).") from WIN32_FIND_DATA containing the times (one for creation, one for last access, one for last modified) and want to convert it to a format mIRC can handle (time_t i think, like the return of $ctime in mIRC), so it can be formatted with $asctime() by mirc or the asctime() function of my dll. (asctime is defined in time.h i think).
My problem is, that i tried to convert it, but nearly all values were wrong. Even a converting by a given function like FileTimeToSystemTime() is incorrect. (although the difference seems to be constante 2 hours, maybe something with timezones?)
Does anyone know how to convert the size correctly? (with code would be nice )
I tried to "turn around" MSDN example , this returned sometimes a nearly correct time (3 secs more or less than mIRC), but sometimes one day and 3 secs more / less.