question

Filip-2434 avatar image
0 Votes"
Filip-2434 asked Castorix31 answered

C++ set local pc time

Hello Everybody.
How can i change the local time on my pc?
Is here way how can i change it with "windows.h"
I used this code but somewho is didn't change.
Thanks for answare.


include <windows.h>

include <stdio.h>


void main()
{
SYSTEMTIME st, lt;
GetLocalTime(&lt);
lt.wHour--;
SetLocalTime(&lt);
}

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered

You must enable the SE_SYSTEMTIME_NAME privilege, as said in the doc

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.