SYSTEMTIME ConvertStringToSystemTime(const char *dateTimeString) const
{
SYSTEMTIME systime;
memset(&systime, 0, sizeof(systime));
// Date string should be "dd-MM-yyyy hh:mm:ss:mss"
auto u = sscanf_s(dateTimeString, "%d/%d/%d%d:%d:%d:%d:%d",
&systime.wDay,
&systime.wMonth,
&systime.wYear,
&systime.wHour,
&systime.wMinute,
&systime.wSecond,
&systime.wMilliseconds);
return systime;
}
My whole problem being is that I'm reading a date from a file, which is stored in a string variable, and I need to subtract the current Systemtime to the one read from the file.
And I was trying to sort it out by converting the string to Systemtime, and then get the difference, but after trying out this function, I keep getting that warning error which I must fix but don't know how exactly.