<p>On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have </p>

<pre><code>int year, month, dayOfMonth, hour, minute, second;
</code></pre>

<p>I obviously should set the wHour, wYear, etc members of the SYSTEMTIME structure, but what happens with wDayOfWeek in that case, I would rather have this set up correctly as well. I have looked but not found any functions in MSDN that would allow me to populate a SYSTEMTIME structure where the wDayOfWeek member would be calculated for me. Did I miss something or how would I go about that?</p>

Hmm...
Maybe first construct a FILETIME and then call FileTimeToSystemTime?
Info on FILETIME
http://msdn.microsoft.com/en-us/library/ms724284(VS.85).aspx
Or, first contruct a VARIANT of VT_TIME and then callVariantTimeToSystemTime.
http://msdn.microsoft.com/en-us/library/ms221440.aspx