Created attachment 7129 [details] code and result picture please see the attachment time_t t1 = 589546905 + 100 * 3600; time_t t2 = 589546905 + 99 * 3600; tm tm1,tm2; localtime_r(&t1,&tm1); localtime_r(&t2,&tm2); the result is the same result: time_t = 589906905 year = 1988 mon = 9 mday = 10 wday = 6 hour = 23 min = 1 sec = 45 time_t = 589903305 year = 1988 mon = 9 mday = 10 wday = 6 hour = 23 min = 1 sec = 45
Created attachment 7130 [details] code the code of localtime error
Created attachment 7131 [details] code and result picture
my system is openSUSE 12.3
Code works for me. What timezone are you using? Did Daylight Saving Time start then?
my timezone east 8 timezone tz = {tz_minuteswest = -480,tz_dsttime = 0} I have not reset timezone,and also have not reset time as well.
Please specify exactly how you set the timezone. What does "date -d @589906905" and "date -d @589903305" print?
Created attachment 7132 [details] code an result picture a new code an result picture
➜ trunk date -d @589906905 Sat Sep 10 23:01:45 CST 1988 ➜ trunk date -d @589903305 Sat Sep 10 23:01:45 CDT 1988
It must be that Daylight Saving Time start.I make a mistake.It is not a bug