Talk:LED clock

From Openmoko

Jump to: navigation, search

Proposed icons

1 Ledclock icon1.png
2 Ledclock icon2.png
3 Ledclock icon3.png
4 Ledclock icon4.png

Problem with LED Clock and US Daylight Savings time

Since the US went on daylight savings time about 1 week ago, LED clock has been displaying the wrong time. It still displays the standard time (one hour before the daylight savings time), even though the phone's own clock display, and the shell "date" command, show the correct, daylight savings time. Do you know why I am having this problem, and how I might fix it?

Thanks for any info!

Ken Young

This can be solved with the following simple patch:

--- /usr/local/ledclock/ledclock.py.orig	Fri Apr  3 13:19:34 2009
+++ /usr/local/ledclock/ledclock.py	Fri Apr  3 13:34:22 2009
@@ -328,7 +328,7 @@
     """Draw the current time"""
     self.set_time_colour(cr)
     self.draw_time(cr, 0,0,w,h, 
-      int(time.time() - time.timezone), 
+      int(time.daylight and (time.time() - time.altzone) or (time.time() - time.timezone)), 
       int(self.options.get('show_seconds', 0)),
       int(self.options.get('24_hour', 1)),
       )

Alef

Personal tools