Author Topic: Datentime Enhancement  (Read 4536 times)

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Datentime Enhancement
« on: March 12, 2007, 08:37:57 am »
I have enhanced the datentime python script which is used to set the date and time to also allow you to set the timezone. I have added an additional third tab which has just a simple dropdown list of 24 timezones, one city for each of the major time lines off GMT. This makes it simple if your city is part of the pick list to set your timezone. If it isn't, you need to set it manually by symlinking your timezone from /usr/share/zoneinfo to /etc/localtime.
Of course you need to actually install the timezones package first in order to be able to select a timezone.
I also have updated the timezones package (timezones_2007_all.ipk) to include the latest daylight savings data.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
Datentime Enhancement
« Reply #1 on: March 12, 2007, 10:05:24 am »
We will add this to the builder...
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

HoloVector

  • Hero Member
  • *****
  • Posts: 533
    • View Profile
    • http://
Datentime Enhancement
« Reply #2 on: March 12, 2007, 10:25:35 am »
Very nice.  Thank you.
I think I'm coming down with what kahm's got!  I now have 3 Zaurii in house!  ;)
Current: Zaurus SL-C3200 -  Bobby (Configuring pdaXii13 Akita with Full 5.4.9 upgrade running IceWM)
Zaurus SL-C1000 - Hachiko (Configuring Cacko 1.23 with evilJazz's new kernel)
Zaurus SL-C860 - Fett (Customized Cacko 1.23 with handmade Boba Fett Theme)
Symbol WiFi CF card|Buffalo WiFi CF Card|Buffalo Ethernet CF Card|Red Piel Frama Case|PDAir Case|Black Pelican 1020 Case|Pentopia Stylii|SaruTek Protectors|Transcend SDs (4GB 150X, 1GB 80X, 256MB 45X, 128MB 45X)|2GB PNY SD|2GB SanDisk SD|Transcend CFs (1GB 80X, 512MB 80X)|Sandisk CFs (4GB, 512MB, 256MB)|256MB Netac USB-CF|RH-1 Remote
Check out the ScummVM@tyrannozaurus page if you are an "adventurer" type of person.

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Datentime Enhancement
« Reply #3 on: March 12, 2007, 10:31:42 am »
I actualy dont know how to program in python and just hacked it together so someone who knows python can probably do a better job and like add a file selector box to browse the zoneinfo directory to pick and select from all the available timezone data, and of course make the dropbox, etc.. look a bit nicer
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Datentime Enhancement
« Reply #4 on: March 12, 2007, 10:56:27 am »
Quote
I actualy dont know how to program in python and just hacked it together so someone who knows python can probably do a better job and like add a file selector box to browse the zoneinfo directory to pick and select from all the available timezone data, and of course make the dropbox, etc.. look a bit nicer
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156016\"][{POST_SNAPBACK}][/a][/div]

Hi Meanie,

if you want to include more than these 24 main cities in the timezones:

You can use a file selector instead of a dropdown list. That's what I have done using a shell script with XDialog using the file selection dialog which is pointed to the zoneinfo directory. The user can select his timezone directly from the tree of timezone files in /usr/share/zoneinfo (which is quite intuitive IMHO).
Then the script links the returned file name to /etc/localtime.

No idea how to embed that into the datentime.py, though    

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Datentime Enhancement
« Reply #5 on: March 12, 2007, 11:03:29 am »
Quote
Quote
I actualy dont know how to program in python and just hacked it together so someone who knows python can probably do a better job and like add a file selector box to browse the zoneinfo directory to pick and select from all the available timezone data, and of course make the dropbox, etc.. look a bit nicer
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156016\"][{POST_SNAPBACK}][/a][/div]

Hi Meanie,

if you want to include more than these 24 main cities in the timezones:

You can use a file selector instead of a dropdown list. That's what I have done using a shell script with XDialog using the file selection dialog which is pointed to the zoneinfo directory. The user can select his timezone directly from the tree of timezone files in /usr/share/zoneinfo (which is quite intuitive IMHO).
Then the script links the returned file name to /etc/localtime.

No idea how to embed that into the datentime.py, though    

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156022\"][{POST_SNAPBACK}][/a][/div]

python has filesel which can be used for just that, but i was too lazy to learn python and do it properly because the dropdown includes Sydney, Tokyo, Singapore, Taipei and Bangkok which are places I go to and they all are already there
« Last Edit: March 12, 2007, 11:05:20 am by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Laze

  • Hero Member
  • *****
  • Posts: 704
    • View Profile
    • http://www.pdaXrom.org
Datentime Enhancement
« Reply #6 on: March 12, 2007, 04:20:53 pm »
Great work based on my old crappy code - I still hate the fact that we made anything in python. One day we might get all the apps to be native c.
C760 running pdaXrom lastest ;-)
SL5500 Running Cacko Qtopia
512 MB SD Card, 128 MB CF Card, Prism2 CF Wlan.

Always visit http://www.pdaXrom.org for latest news.

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Datentime Enhancement
« Reply #7 on: March 13, 2007, 01:00:19 pm »
Fresh flash of pdaxii13-akita5.3.2 last night on my C3200
My time settings don't "stick". I just rebooted for an unrelated reason and my clock went back 6 hours.
I selected "GMT -6 Saskatchewan" and the clock is still 6 hours behind.
I Live in the same timezone as Chicago, and it is also GMT -6
Do I need to manually link this to make it keep time after a reboot?

EDIT:
I set my clock to the correct time in the datentime app, then rebooted again.
It goes back 6 hours just like my first reboot.
« Last Edit: March 13, 2007, 01:21:11 pm by Jon_J »
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Datentime Enhancement
« Reply #8 on: March 13, 2007, 02:52:19 pm »
I renamed /etc/localtime to localtime_old
Then I symlinked my timezone to /ect/localtime

ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

This created a new /etc/localtime link (I checked it, and it is linked to Chicago)
I rebooted, and my clock still looses 6 hours.
How can I make the clock "remember" the correct time for where I live?
« Last Edit: March 13, 2007, 02:52:45 pm by Jon_J »
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

T3_slider

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Datentime Enhancement
« Reply #9 on: March 13, 2007, 07:09:33 pm »
Well, I'm no expert, but rebooting might be resetting the hardware clock (well, from what I understand there is no real hardware clock, but there is a figurative one that still accepts commands). After setting the correct time in the datentime app, in a terminal execute
Code: [Select]
/sbin/hwclock --systohc(You don't really need the /sbin/ since pdaXrom runs as root, so you could just type hwclock --systohc, but in case you have a wonky setup that doesn't run as root the first command should always work).

Or if you want to keep your figurative hardware clock in UTC (this never works for me, it always goes to local time even on my Slackware box), you can type
Code: [Select]
/sbin/hwclock --systohc --utc instead.

If this doesn't work someone more intelligent will need to help you out.
Conics SL-C3200 running pdaXrom beta3 and XFCE with a Planex WiFi CF card.

Slackware rules!

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Datentime Enhancement
« Reply #10 on: March 13, 2007, 07:13:36 pm »
Thanks T3_slider for the tips.
On the previous install of pdaxii13-akita5.3, the clock didn't do this.
It always remembered the time when rebooting.
This situation was introduced (I think) by the new version of pdaxii13-akita5.3.2
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

T3_slider

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Datentime Enhancement
« Reply #11 on: March 13, 2007, 07:20:25 pm »
Jon_J, does the "hwclock --systohc" actually fix the problem or not (if so then it would just be a matter of adding the command to the datentime app I think -- if not there are bigger problems).
Conics SL-C3200 running pdaXrom beta3 and XFCE with a Planex WiFi CF card.

Slackware rules!

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Datentime Enhancement
« Reply #12 on: March 13, 2007, 07:29:21 pm »
no, that didn't do anything that I can tell, the clock still resets after rebooting. I was going to wait for meanie, he modified the datentime file, so maybe he will know what is going on.
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Datentime Enhancement
« Reply #13 on: March 13, 2007, 09:10:14 pm »
the default timezone, ie none will be around GMT 0, so after you set your timezone, the internal clock will readjust your time using the current time plus the timezone you are in. This means you will be a few hours ahead or behind and need to then set your time again for you timezone and reboot.
« Last Edit: March 13, 2007, 09:11:17 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Datentime Enhancement
« Reply #14 on: March 13, 2007, 09:51:47 pm »
Quote
the default timezone, ie none will be around GMT 0, so after you set your timezone, the internal clock will readjust your time using the current time plus the timezone you are in. This means you will be a few hours ahead or behind and need to then set your time again for you timezone and reboot.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156190\"][{POST_SNAPBACK}][/a][/div]
I'm not following you meanie, sorry.
you said to set your time zone.
I do this.
Then you say to set the time.
I would do this, but my time remained the same after I set my timezone. Should I just close and reopen datentime and click [OK]?
This is what I did, I closed and reopened datentime and just clicked [OK]
Now I'm rebooting...
After rebooting, the time lost 6 hours, again.
EDIT:
Doesn't anyone else with pdaxii13-akita5.3.2 have this problem??

I also tried setting the timezone, then just closing datentime and rebooting, but this method loses 6 hours also.
When I set the timezone, nothing changes with the clock.
« Last Edit: March 13, 2007, 10:04:12 pm by Jon_J »
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers