How to fill in the SYSTEMTIME value?

On Windows Mobile (but I think it’s the same on Windows) in a native C ++ application, how would I decide to configure the SYSTEMTIME structure correctly? Assuming I have

int year, month, dayOfMonth, hour, minute, second;

I obviously have to set the elements wHour, wYear, etc. SYSTEMTIME structures, but what happens to wDayOfWeek in this case, I would prefer it to be configured correctly. I looked, but did not find any functions on MSDN that would allow me to populate the SYSTEMTIME structure in which the wDayOfWeek member would be calculated for me. Am I missing something or how can I do this?

+3
source share
3 answers

You can fill in the fields you know, and then convert to another time and back.

.

+3

...

, FILETIME, FileTimeToSystemTime?

FILETIME
http://msdn.microsoft.com/en-us/library/ms724284(VS.85).aspx

VT_TIME, VariantTimeToSystemTime. http://msdn.microsoft.com/en-us/library/ms221440.aspx

+1

Source: https://habr.com/ru/post/1699510/


All Articles