I am using DLib for your IAR compiler and would like to convert UTC timestamp to local timestamp.
I am hosted in Germany, so my implementation for the __getzone method is as follows:
char const * __getzone() {
return ":GMT+1:GMT+2:0100:(1980)032502+0:102503+0";
}
I wrote some test codes:
time_t ts = 1509238797L;
struct tm* pre = localtime(&ts);
time_t after = ts + 5L;
struct tm* post = localtime(&after);
The variable "pre" is good, but the variable "post" contains the value: 10/29/2017 - 03:00: 02, but it should be 2017/10/29 - 02: 00: 02.
I've debugged the code in Visual Studio and everything seems to work there. Did I miss something?
source
to share