0
FILETIME uint64_t
처럼 해석하고 주위에 인터넷 검색과 내가 잘못 작동 코드를 다음에 붙어 한 약간의 디버깅 후 FILETIME
캐스트 uint64_t, 나는 파일에서 바이트 배열을 얻으려고
이 UINT 캐스팅합니다. FILETIME_OFFSET
에서
uint64_t win_filetime = *(uint64_t*)(&(((char*)buf)[(int)FILETIME_OFFSET]));
//at this moment win_filetime = 0x01cb3f90e7b52500
buf
필요 포함 바이트 그런 기능
tm FILETIME_to_time_t(const FILETIME *lpFileTime) {
time_t result;
SYSTEMTIME st;
struct tm tmp;
FileTimeToSystemTime(lpFileTime,&st);
memset(&tmp,0,sizeof(struct tm));
tmp.tm_mday = st.wDay;
tmp.tm_mon = st.wMonth - 1;
tmp.tm_year = st.wYear - 1900;
tmp.tm_sec = st.wSecond;
tmp.tm_min = st.wMinute;
tmp.tm_hour = st.wHour;
return tmp;
}
기능 FILETIME_to_time_t()
반환 쓰레기에 전달하는 t1 = *(FILETIME *)(&win_filetime);
또는
t1.dwLowDateTime = (DWORD)win_filetime;
t1.dwHighDateTime = (DWORD)(win_filetime >> 32);
캐스팅하려고 (즉,파일 년 = 110)
샘플 값 : 0025B5E7903FCB0100
HexWorkshop이 제대로 2010년 8월 19일
어쩌면이 엔디안 변환 또는 지금 발견 할 수없는있어 또 하나의 부족?
코드에서 1900을 뺀 후에 연도 = 110이 2010이 아니라고 확신합니까? –
네, 잘 잡으세요. 나는 이것을 strftime 전에 직접'record-> filetime-> tm_year = record-> filetime-> tm_year-1900;으로 바꾸었다. 많은 도움에 감사드립니다. –
안녕하세요. 문제를 해결할 수 있도록 답변을 수락 할 수 있도록 답글을 다시 정리했습니다. –