Time is advanced in program .C

5

I have an application in .c , I ended it but I have a problem with the time. Example: I am recording everything that is done with date and time only the time is advanced. When I do an operation at 12:54 the displayed time is 15:54:16, the code below follows:

  

Note: computer time is correct.

SYSTEMTIME str_t;
GetSystemTime(&str_t);

After that access the information, and the str_t in debug already has the wrong time.

    
asked by anonymous 13.10.2014 / 17:56

1 answer

8

According to the documentation of this function the return is done at UTC (which is basically GMT time) and your computer is probably in working hours Brasilia, which is three hours late. So you're picking the time correctly, you're just forgetting that you need to treat it properly for what you want, that is, apply the time zone.

On the other hand, if you want to catch the local time use the correct function, in the case a GetLocalTime() .

    
13.10.2014 / 17:59