Pergunta

Right now I do something like this:

    SYSTEMTIME st;

    st.wHour = 6;
    st.wMinute = 23;

    BOOL result = SetSystemTime(&st);

The goal is to get it to show that exact time on my local machine. When I run the program it changes it to 8:23 instead of 6:23. How can I get it to show the correct local time?

Foi útil?

Solução

SetSystemTime() expects the provided time to be in UTC. If you want to set the time using the local time, use SetLocalTime().

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top