[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Weird time-zone oscillation



On Fri, Dec 11, 2009 at 03:25:05AM -0600, Kumar Appaiah wrote:
> Dear Debian user,
> 
> I have a weird time-zone related issue on my machine. I observed that
> the "alarm-clock" package was always ignoring my requests for an alarm
> within an hour from now, and all other alarms used to go off with an
> hour to spare. 

When exactly does the alarm-clock program use the time-zone data?

> So, I did some investigation, and found that it always
> converted fixed times to the incorrect time, while the current time is
> more clear.
> 
> To make it more clear, I wrote the following program:
> 
> /*  gcc `pkg-config --cflags --libs glib-2.0` test.c -Wall */
> #include <glib.h>
> #include <stdio.h>
> 
> int
> main(void) {
>   GTimeVal alarm_time, current_time;
>   char *iso_date = "2009-12-11T2:50:00";
>   g_time_val_from_iso8601(iso_date, &alarm_time);
>   printf("%ld\n", alarm_time.tv_sec);
>   g_get_current_time(&current_time);
>   return 0;
> }
> 
> Now, please observe the following outputs:
> 
> [kumar@bluemoon ~] for i in `seq 1 10`;do TZ=America/Chicago ./a.out;done
> 1260517800
> 1260521400
> 1260517800
> 1260517800
> 1260517800
> 1260521400
> 1260517800
> 1260521400
> 1260521400
> 1260521400
> 
> [kumar@bluemoon ~] for i in `seq 1 10`;do TZ=Europe/Zurich ./a.out;done
> 1260492600
> 1260496200
> 1260496200
> 1260496200
> 1260496200
> 1260496200
> 1260492600
> 1260496200
> 1260492600
> 1260496200
> 
> Please note that the two different times are separated by an
> hour. This led me to suspect daylight savings. Sure enough, with
> Asia/Calcutta and Etc/UTC, I got constant values.
> 
> I am sure my computer's timekeeping is OK. I could not reproduce this
> in any other Debian machines I have access to. In addition, on a Lenny
> chroot in the SAME machine, I could not reproduce it (everything was
> in order). Could someone suggest as to why this is happening?
> 
> I use sid, and the glib version is 2.22.3-1.

-- 
Tzafrir Cohen         | tzafrir@jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir@cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend


Reply to: