WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tzdata  (Read 11041 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10961
Re: tzdata
« Reply #15 on: March 23, 2010, 08:29:28 AM »
Instead of a reboot, a logout + login would also do.
The only barriers that can stop you are the ones you create yourself.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: tzdata
« Reply #16 on: March 23, 2010, 02:23:09 PM »
@JeffW: I believe you have a couple of other ways to influence the timezone and they all revolve around the environment variable TZ.

(1) You could change TZ in the current shell, but that setting is lost as soon as the current shell terminates:
tc@box:~$ date
Tue Mar 23 20:42:16 UTC 2010
tc@box:~$ sh
tc@box:~$ TZ=CST6CDT,M3.2.0,M11.1.0
tc@box:~$ date
Tue Mar 23 15:42:39 CDT 2010
tc@box:~$ exit

tc@box:~$ date
Tue Mar 23 20:42:44 UTC 2010
tc@box:~$


(2) You could amend the '.ashrc' file, this would not change the current shell, but all new shells of the current user moving forward.
tc@box:~$ echo 'TZ=CST6CDT,M3.2.0,M11.1.0' >> $HOME/.ashrc
tc@box:~$ date
Tue Mar 23 20:51:24 UTC 2010
tc@box:~$ sh
tc@box:~$ date
Tue Mar 23 15:51:29 CDT 2010
tc@box:~$ exit

tc@box:~$ date
Tue Mar 23 20:52:04 UTC 2010

Please note that this change is limited to the current user and without other steps (e.g. backup of $HOME/.ashrc) will not persist. To achieve a more system wide impact, I guess changing '/etc/skel/.ashrc' might be the way to go, but it depends on your setup how this amendment will persist.

I guess it really depends on your choice of persistence. In my view for example adding a 'tz=CST6CDT,M3.2.0,M11.1.0' boot code into a GRUB stanza is a pretty simple thing to do (if you use GRUB). But you could also re-master your initrd (changing '/etc/skel/.ashrc') or the boot code in your ISO file (e.g. if using a CD-ROM to boot).

A few weeks ago I've written in another thread what I know about setting the TZ variable: http://forum.tinycorelinux.net/index.php?topic=5017.msg27012#msg27012 This might help you further, if the appropriate value for the TZ variable appears to be a bit of a mystery.

Offline Jeff W

  • Newbie
  • *
  • Posts: 5
Re: tzdata
« Reply #17 on: March 29, 2010, 03:46:43 PM »
In my current setup I am running text only mode.  When the machine boots I would like it to connect to a DHCP network, run an IP location script, then using the nearest geographic location returned by the script automatically set the timezone.  If no valid location results then default switch timezone from UTC to GMT name.  The machine will keep these settings through the entire session and for any new sessions such as other users telnet into the device.  The whole process will start again when the box is rebooted.  I will also have a menu script I run which will allow me to choose the timezone from a list manually and set the timezone if the script should fail.
If at first you don't suceed skydiving is not for you.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tzdata
« Reply #18 on: June 09, 2010, 01:54:45 PM »
Thanks to robc for an update:

Code: [Select]
Title:          tzdata.tcz
Description:    Time Zone Data (TESTING)
Version:        2010j/2010j
Author:         Arthur David Olson
Original-site:  http://www.twinsun.com/tz/tz-link.htm
Copying-policy: Public Domain
Size: 648K
Extension_by:   robc
Comments: This package requires bash and gawk.

Includes tzcode2010j and tzdata2010j.

Use the full path at the boot prompt, ie:
TZ=/usr/local/share/zoneinfo/US/Pacific

----------------------------------------------

Please see the man page for additional
information.

Also see http://www.twinsun.com/tz/tz-link.htm
for more information.

----------------------------------------------

This extension is PPI compatible.

Change-log:     2009/07/17 Original
2009/11/12 Updated to tzdata2009r and tzcode2009r
2010/03/10 Updated to tzcode2010c and tzdata2010e
2010/06/08 Updated to tzcode2010j and tzdata2010j
Current: 2010/06/08 Updated to tzcode2010j and tzdata2010j