Comment 1 for bug 11629

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Sun, 24 Oct 1999 04:59:16 -0700 (PDT)
From: "Sean 'Shaleh' Perry" <email address hidden>
To: <email address hidden>
Subject: localtime and friends does not watch for timezone changes

Package: libc6
Version: 2.1.2-5

applications using localtime to acquire locale or timezone data are not
informed of a timezone switch. So, if you start and application that uses
strftime() for instance, then run tzconfig to change the timezone, the proper
time is not shown, instead the previous value is.

one:~/test_code$ ./time
Sun Oct 24 7:56 AM EDT EST,EDT
Sun Oct 24 7:56 AM EDT EST,EDT
< run tzconfig on another term >
Sun Oct 24 7:56 AM EDT EST,EDT
Sun Oct 24 7:56 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT
Sun Oct 24 7:57 AM EDT EST,EDT

note how time never changes

while (1) {
        tmp = time(NULL);
        tt = localtime(&tmp);
        strftime(t, 1024, "%a %b %e %l:%M %p %Z", tt);
        printf("%s %s,%s\n", t, tzname[0], tzname[1]);
        memset(t, '\0', 1024);
        sleep(1);
}

simple code I used to prove this exists.

If I can help, please contact me.