Dear Simon and Ryan,

I have a problem close to the situation described here; I couldn't set
any alarms to within an hour from now, and if I set an alarm at any
time beyond that, it would ring an hour earlier, i.e. an alarm set for
1 hour and 1 minute later will ring in a minute, an alarm for 2 hours
rings in 1 hour etc.

So, when I tried going through the code, I discovered that for some
reason, the time I specified was always reduced by an hour. To verify
what was happening, I ran 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;
  char *iso_date = "2009-12-11T2:50:00";
  g_time_val_from_iso8601(iso_date, &alarm_time);
  printf("%ld\n", alarm_time.tv_sec);
  return 0;
}

And, to my surprise, each time I ran it, I got one of two different
values, fairly randomly:

[ku...@bluemoon ~] !fo
for i in `seq 1 10`;do ./a.out ;done
1260517800
1260517800
1260521400
1260517800
1260521400
1260517800
1260521400
1260517800
1260517800
1260517800

Notice that the values are separated by 3600 seconds, which led me to
suspect the time zone. I then ran the alarm-clock program with a no
daylight savings time-zone, like

TZ=Asia/Calcutta alarmclock
TZ=Etc/UTC alarmclock

Both times, the program worked flawlessly.

Simon, does your problem resemble this, or is it something else?

Thanks.

Kumar
-- 
Light finds her treasure of colours
through the antagonism of clouds.
- Rabindranath Tagore (Fireflies, 1928)

Attachment: signature.asc
Description: Digital signature

Reply via email to