I want to retrieve the last write date on a file. I have written this code for it, but it returns me 52428 in values like "Year" all the time
int LastErrorCode;
LPCSTR Path = "C:/Users/Username/Desktop/Picture.PNG";
WIN32_FIND_DATA Information;
if(!FindFirstFile(Path, &Information))
{
int LastErrorCode = GetLastError();
cout << "FIND FIRST FILE FAILED" << endl;
cout << LastErrorCode << endl;
}
SYSTEMTIME MyTime;
FILETIME MyFileTime = Information.ftLastWriteTime;
if(!FileTimeToSystemTime(&MyFileTime, &MyTime))
{
LastErrorCode = GetLastError();
cout << "FILE TIME TO SYSTEM TIME FAILED" << endl;
cout << LastErrorCode << endl;
}
cout << MyTime.wYear << endl;