Setting Time Zone

Please post any bugs you have found
Post Reply
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#16 Post by Karl Godt »

I have tested the /usr/sbin/timezone-set script @slacko and reverting the +/- works for me .
I guess it is a leftover or a workaround for wrong configured files @/usr/share/zoneinfo/*

Since tzselect is part of the [e]glibc package it might be also related to the /lib/glibc* --version .

Diff :

Code: Select all

--- /initrd/pup_ro2/usr/sbin/timezone-set	2010-05-26 06:47:03.000000000 -0100
+++ /usr/sbin/timezone-set	2011-10-29 22:02:16.000000000 -0100
@@ -25,18 +25,20 @@ if [ -e /etc/localtime ];then
  CZONE="`readlink /etc/localtime`"
  DEFTAG="`readlink /etc/localtime | sed -e 's%/usr/share/zoneinfo/%%'`"
 else
- CZONE='/usr/share/zoneinfo/Etc/GMT-8' #these have opposite sign.
- DEFTAG='Etc/GMT-8'
+ CZONE='/usr/share/zoneinfo/Etc/GMT+8' #these have opposite sign.
+ DEFTAG='Etc/GMT+8'
 fi
-if [ "`echo -n "$DEFTAG" | grep 'GMT' | grep '\+'`" = "" ];then
- DEFTAG="`echo -n "$DEFTAG" | sed -e 's%Etc/%%' | tr "\-" "\+"`"
-else
- DEFTAG="`echo -n "$DEFTAG" | sed -e 's%Etc/%%' | tr "\+" "\-"`"
+#if [ "`echo -n "$DEFTAG" | grep 'GMT' | grep '\+'`" = "" ];then
+# DEFTAG="`echo -n "$DEFTAG" | sed -e 's%Etc/%%' | tr "\-" "\+"`"
+#else
+# DEFTAG="`echo -n "$DEFTAG" | sed -e 's%Etc/%%' | tr "\+" "\-"`"
+#fi
+if [ "`echo -n "$DEFTAG" | grep 'GMT'`" != "" ];then
+DEFTAG=${DEFTAG#*/}
 fi
-
 #100526 screen out UTC timezone, causes confusion...
 ZONEINFO="`find /usr/share/zoneinfo -type f | grep -v '\.tab$' | grep -v 'UTC' | sed -e 's%/usr/share/zoneinfo/%%' | sed -e 's%Etc/%%' | tr ' ' '_' | sort | tr '\n' ' '`"
-
+echo "$DEFTAG"
 ZONECHOICES=""
 for ONEZONE in $ZONEINFO
 do
@@ -91,11 +93,11 @@ fi
 
 ZONERETVAL="`cat /tmp/zoneretval`"
 
-if [ "`echo -n "$ZONERETVAL" | grep 'GMT' | grep '\+'`" = "" ];then
- ZONERETVAL="`echo -n "$ZONERETVAL" | tr "\-" "\+"`"
-else
- ZONERETVAL="`echo -n "$ZONERETVAL" | tr "\+" "\-"`"
-fi
+#if [ "`echo -n "$ZONERETVAL" | grep 'GMT' | grep '\+'`" = "" ];then
+# ZONERETVAL="`echo -n "$ZONERETVAL" | tr "\-" "\+"`"
+#else
+# ZONERETVAL="`echo -n "$ZONERETVAL" | tr "\+" "\-"`"
+#fi
 
 #validity check...
 [ "`echo "$ZONEINFO" | grep "$ZONERETVAL"`" = "" ] && exit

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#17 Post by tasmod »

Karl,

The problems are not of Puppys making as I stated but a Linux convention.

I've no idea why it's done this way, it just is.

Not Puppy's fault but standard LInux:-

tzdata is in reverse notation.

date doesn't reverse GMT report

As I mentioned earlier, hwclock works to set the rtc BUT reports back in localtime format. (What a confusion)

===

Psync has had a bug introduced a few versions back when I catered for the GMT/UTC users.
It would not sync the rtc clock but would sync the software system clock so most users wouldn't have noticed.

It was just a single character to fix it but I was surprised no-one had noticed it.

Version 2.7 of Psync now syncs the rtc and also reports what the DST dates are if timezone set. (I must stop using the word locale, I tend to think of this as everything related to zone, country etc.)

According to the BBC video link about timezones I posted in announcements, GMT-1 is only a couple of areas. ( I remember the Azores as one)
If it's still on it's well worth the look, very interesting. Especially Antarctica and the timezone use there, where in effect all timezones meet !!
Arctic is different as there are few people there compared to the Antarctic study groups.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#18 Post by Karl Godt »

It was just a single character to fix it but I was surprised no-one had noticed it.
I have never used it , as perhaps 1/3 of the Menu entries .

Post Reply