unstable mktime result
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi all,
Mktime has different results when using dates that coincide with times that "didn't" exist due to a change of the reference for the specific timezone. In the examples I've run, when it's first called, it returns a past (IMHO invalid) value. After it's called for another date, calling it again for the first date, returns the expected result.
I found this happens on 1912-01-01 for Europe/Lisbon timezone and 1910-10-01 for Europe/Istanbul and it may be happening on other cases. I also found a similar case where it doesn't happen, 1940-05-15 for Europe/Amsterdam.
The tests I made are available here: https:/
Running them:
gcc test_europe_
TZ='Europe/Lisbon' ./test_
gcc test_europe_
TZ='Europe/
gcc test_europe_
TZ='Europe/
Although I run these tests on Ubuntu 14.10, I saw this also happening on a Ubuntu 12.04 machine.
lsb_release -rd
Description: Ubuntu 14.10
Release: 14.10
sudo apt-cache policy libc6
libc6:
Installed: 2.19-10ubuntu2.3
Candidate: 2.19-10ubuntu2.3
Version table:
*** 2.19-10ubuntu2.3 0
500 http://
500 http://
100 /var/lib/
2.19-10ubuntu2 0
500 http://
Thank you!
I had the I think the same problem with mktime().
(Ubuntu EGLIBC 2.19-0ubuntu6.8) 2.19
With input data: tm_year= 10; tm_mon= 0; tm_mday= 1; tm_hour= 0; tm_min= 0; tm_sec= 0;
struct tm testtime = {0};
testtime.
testtime.
testtime.
testtime.
testtime.
testtime.
mktime(t) int -1893459600 for "Europe/Budapest"
mktime(t) int -1893456000 for "Europe/London"
mktime(t) int -1893462264 ??? for "Europe/Bucharest"
for tm_year= 50; tm_mon= 0; tm_mday= 1; tm_hour= 0; tm_min= 0; tm_sec= 0;
struct tm testtime = {0};
testtime.
testtime.
testtime.
testtime.
testtime.
testtime.
mktime(t) int -631155600 for "Europe/Budapest"
mktime(t) int -631152000 for "Europe/London"
mktime(t) int -631159200 for "Europe/Bucharest"
mktime(t) int -631134000 for "America/Nipigon"