freebsd-ports/x11-clocks/gdesklets-clock/files/Clock::__init__.py
Pav Lucistnik ebd7f1c8a4 - Fix clock when timezone is set to "local". This is similar fix
that went to gdesklets-ltvariations.

PR:		ports/64944
Submitted by:	Tim Bishop <tim@bishnet.net>
Approved by:	maintainer
2004-03-30 21:51:46 +00:00

16 lines
738 B
Python

--- __init__.py.bak Tue Mar 30 18:08:39 2004
+++ __init__.py Tue Mar 30 18:11:36 2004
@@ -149,8 +149,11 @@
timezone = self._get_config("timezone")
if (timezone != self.__timezone):
self.__timezone = timezone
- offset = commands.getoutput("TZ=\"%(timezone)s\" date +%%z"
- % vars())
+ if timezone == "localtime":
+ offset = commands.getoutput("date +%z")
+ else:
+ offset = commands.getoutput("TZ=\"%(timezone)s\" date +%%z"
+ % vars())
sign = (offset[0] == "+") and 1 or -1
hours = int(offset[1:3])
mins = int(offset[3:5])