Robert Withrow wrote:
Sorry to reply to my own message, but I discovered that /etc/profile
sets the TZ environment variable if /etc/localtime doesn't exist.  If I
unset TZ (or log out and in again) the below works.  Maybe I'll put this
into the Wiki.
That (wiki help) would be great.

Also, there have been a few entries on the wiki (I am one of the guilty parties... :P) about auto-setting timezone data.
The basic use case is this:
if I travel, I want my timezone updated, but not the system clock (which should be UTC if it is a good little linux system...) - then all calendar entries (which should be stored in UTC internally!) would be accurate.
There are two sources that could automate this:
1) the local time that is broadcast from the GSM towers - an offset could be calculated and an _appropriate_ timezone could be automatically chosen (note that there can be more than one timezone with the same offset at a given time of the year, so it would not be able to distinguish between those, although perhaps there could be a 'favorites' list of timezones in the user's profile) - at minimum, the offset would be correct. 2) there is a gps and provided an appropriate lookup table, timezone could be determined unequivocally - the problem with this method is that I don't know of any free source of this data (geocoded), but it may exist.

I honestly think the first is the easiest to implement, and would work on _any_ gsm phone, not just one with an embedded GPS, so would be more portable. The second is undoubtedly more accurate.

Is there a good way to interface to tzdata without requiring logout/login? force reload in a session? Does it require separate ipkgs for each timezone, or is there a way to just enter the offset? (I would argue that when you are traveling, you only care about the offset anyway) Is this a dbus interface? a scripting interface? how to make it non-hackish?

I would appreciate thoughts on this. There hasn't been a lot of activity on the wiki around it.

Apologies if this is viewed as thread-jacking. Not intended as such - I just feel that with a 'location-aware' device, a user shouldn't have to enter things like timezone - the system should just 'know'.

thanks,
joshua
Robert Withrow wrote:
I've searched the Wiki and the mailing lists and the Internet in
general, and what I see for setting the timezone on my Neo is to either
install "timezones" or "tzdata" and the link the appropriate thing into
/etc/localtime.  Neither way works for me.

This is with tzdata, but I get the same result using timezones and
timezone-america:

[EMAIL PROTECTED]:/usr/share/zoneinfo$ date
Thu Nov  1 23:48:10 UTC 2007
[EMAIL PROTECTED]:/usr/share/zoneinfo$ ipkg install tzdata-americas
tzdata-posix
Installing tzdata-americas (2007e-r0) to root...
Downloading
http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/armv4t/tzdata-americas_2007e-r0_armv4t.ipk
Installing tzdata-posix (2007e-r0) to root...
Downloading
http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/armv4t/tzdata-posix_2007e-r0_armv4t.ipk
Configuring tzdata-americas
Configuring tzdata-posix
[EMAIL PROTECTED]:/usr/share/zoneinfo$ ln -s
/usr/share/zoneinfo/posix/US/Eastern /etc/localtime
[EMAIL PROTECTED]:/usr/share/zoneinfo$ date
Thu Nov  1 23:49:19 UTC 2007
[EMAIL PROTECTED]:/usr/share/zoneinfo$ ls -l /etc/localtime
lrwxrwxrwx    1 root     root           36 Nov  1 23:49 /etc/localtime
-> /usr/share/zoneinfo/posix/US/Eastern
[EMAIL PROTECTED]:/usr/share/zoneinfo$ /bin/date
Thu Nov  1 23:50:23 UTC 2007

What stupid mistake am I making?




Reply via email to