Bug 15808 - localtime operator error
Summary: localtime operator error
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-31 03:48 UTC by Felowria
Modified: 2014-06-13 13:17 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
code and result picture (97.16 KB, image/jpeg)
2013-07-31 03:48 UTC, Felowria
Details
code (257 bytes, text/x-c++src)
2013-07-31 04:03 UTC, Felowria
Details
code and result picture (97.16 KB, image/jpeg)
2013-07-31 04:07 UTC, Felowria
Details
code an result picture (103.08 KB, image/jpeg)
2013-07-31 08:06 UTC, Felowria
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Felowria 2013-07-31 03:48:51 UTC
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
Comment 1 Felowria 2013-07-31 04:03:08 UTC
Created attachment 7130 [details]
code

the code of localtime error
Comment 2 Felowria 2013-07-31 04:07:13 UTC
Created attachment 7131 [details]
code and result picture
Comment 3 Felowria 2013-07-31 04:08:15 UTC
my system is openSUSE 12.3
Comment 4 Allan McRae 2013-07-31 04:24:36 UTC
Code works for me.

What timezone are you using?  Did Daylight Saving Time start then?
Comment 5 Felowria 2013-07-31 06:10:48 UTC
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.
Comment 6 Andreas Schwab 2013-07-31 07:18:02 UTC
Please specify exactly how you set the timezone.  What does "date -d @589906905" and "date -d @589903305" print?
Comment 7 Felowria 2013-07-31 08:06:35 UTC
Created attachment 7132 [details]
code an result picture

a new code an result picture
Comment 8 Felowria 2013-07-31 08:08:29 UTC
➜  trunk  date -d @589906905
Sat Sep 10 23:01:45 CST 1988
➜  trunk  date -d @589903305
Sat Sep 10 23:01:45 CDT 1988
Comment 9 Felowria 2013-07-31 08:11:05 UTC
It must be that Daylight Saving Time start.I make a mistake.It is not a bug