When calling Everything_GetResultDateModified in my program, i got the modify date of file in UTC。
Is there a modifer or option to get the local time.
void CustomSearch(std::wstring regexStr, bool regexFlag) {
DWORD i;
const int MAX_TIME_LEN = 60;
char strTime[MAX_TIME_LEN] = { 0x00 };
Everything_SetSearchW(regexStr.c_str());
Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME
| EVERYTHING_REQUEST_PATH
| EVERYTHING_REQUEST_DATE_MODIFIED);
// execute the query
Everything_QueryW(true);
int numResults = Everything_GetNumResults();
for (i = 0; i < numResults; i++)
{
wchar_t buf[MAX_PATH_LEN] = { 0x00 };
Everything_GetResultFullPathNameW(i, buf, MAX_PATH_LEN);
FILETIME dateModified;
SYSTEMTIME st;
bool ret = Everything_GetResultDateModified(i, &dateModified);
DWORD dwLastError = Everything_GetLastError();
if (dwLastError == EVERYTHING_ERROR_INVALIDCALL)
{
continue;
}
FileTimeToSystemTime(&dateModified, &st);
sprintf(strTime, "%d/%d/%d %02d:%02d:%02d",
st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
}
I know I can call FileTimeToLocalFileTime in my program. But if the search result count is an huge number, the performance would be slow down.
So is there a modifer or option to get the local time?