Tiny Core Linux

Tiny Core Extensions => TCE News => TCE 2.x => Topic started by: Jason W on July 19, 2009, 05:04:16 PM

Title: tzdata
Post by: Jason W on July 19, 2009, 05:04:16 PM
Thanks to robc for:

Code: [Select]
Title:          tzdata.tcel
Description:    Time Zone Data (TESTING)
Version:        2009
Author:         Arthur David Olson
Original-site:  ftp://elsie.nci.nih.gov/pub/
Copying-policy: Public Domain
Size: 497.4k
Extension_by:   robc
Comments: This package requires bash and gawk.

Includes tzdata2009j and tzcode2009i.

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

Please see the man page for additional
information.

Also see ftp://elsie.nci.nih.gov/pub/
for more information.

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

This extension is PPI compatible.

Change-log:     2009/07/17 Original
Current: 2009/07/17 Original


Code: [Select]
Title:          tzdata.tczl
Description:    Time Zone Data (TESTING)
Version:        2009
Author:         Arthur David Olson
Original-site:  ftp://elsie.nci.nih.gov/pub/
Copying-policy: Public Domain
Size: 444k
Extension_by:   robc
Comments: This package requires bash and gawk.

Includes tzdata2009j and tzcode2009i.

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

Please see the man page for additional
information.

Also see ftp://elsie.nci.nih.gov/pub/
for more information.

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

This extension is PPI compatible.

Change-log:     2009/07/17 Original
Current: 2009/07/17 Original

Title: Re: tzdata
Post by: jur on October 10, 2009, 05:41:06 AM
I'm having a struggle with getting my time zone to work correctly... what is this man page that is mentioned? I searched at linux man pages but nothing for tzdata or tz.
Title: Re: tzdata
Post by: curaga on October 10, 2009, 05:57:06 AM
You can use only the data in this extension, without the tzselect script. Of course tzselect does help you in finding the right file.
Just copy the right timezone file as /etc/localtime, add /etc/localtime to backup. After that, the extension is not needed.

Since the data is in /usr/local, I don't think just setting TZ would work.
Title: Re: tzdata
Post by: roberts on October 10, 2009, 11:04:20 AM
Don't forget it is simpe to set timezone via TZ without the need of an extension, just the base Tiny Core.
See: http://www.tinycorelinux.com/faq.html#timezone
Title: Re: tzdata
Post by: jur on October 10, 2009, 05:49:21 PM
Thanks for that reference! I had seen it before but I have seen so many other things that I forget... :P

I have tried tz=GMT-11 but it doesn't work.

Is there a reference where the various codes are listed? I am in Melbourne Australia; we have DST and the local time is dubbed EST (eastern standard time). I am unsure how to construct a code from your example: here is a crack at it, assuming EST will be recognised:

tz=EST,M10.1.0/2,M4.1.0/2  (not sure what the +8PDT means in your example...?
Title: Re: tzdata
Post by: jur on October 10, 2009, 05:53:57 PM
Just rebooted and the time seems to be correct.  ;D
Title: Re: tzdata
Post by: robc on October 10, 2009, 07:53:54 PM
To use the tzdata information from the boot options line you need to specify the full path to the tz file, i.e. tz=/usr/local/share/zoneinfo/Australia/Melbourne

In my remasters I put the /usr/local/share/zoneinfo/ part in the tc-config file so only Australia/Melbourne would be needed, but that requires a remaster.
Title: Re: tzdata
Post by: Jason W on November 13, 2009, 07:54:24 AM
Thanks to robc for an update:

Code: [Select]
Title:          tzdata.tczl
Description:    Time Zone Data (TESTING)
Version:        2009r/2009r
Author:         Arthur David Olson
Original-site:  ftp://elsie.nci.nih.gov/pub/
Copying-policy: Public Domain
Size: 640k
Extension_by:   robc
Comments: This package requires bash and gawk.

Includes tzdata2009r and tzcode2009r.

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

Please see the man page for additional
information.

Also see ftp://elsie.nci.nih.gov/pub/
for more information.

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

This extension is PPI compatible.

Change-log:     2009/07/17 Original
2009/11/12 Updated to tzdata2009r and tzcode2009r
Current: 2009/11/12 Updated to tzdata2009r and tzcode2009r

Title: Re: tzdata
Post by: reidi on December 25, 2009, 05:35:18 PM
Don't forget it is simpe to set timezone via TZ without the need of an extension, just the base Tiny Core.
See: http://www.tinycorelinux.com/faq.html#timezone

This is both useful and useless information, because the author neglected to indicate where TZ should be set.  IMHO this should not be assumed knowledge.


Please excuse the rudeness borne of frustration above.  As roberts points out, on http://www.tinycorelinux.com/faq.html#bootcodes (http://www.tinycorelinux.com/faq.html#bootcodes), the section "What Bootcodes does Tiny Core Support?" does explain how to use TZ.  I did not understand that from the section "How To Timezone?" on the same page, yet it clearly states "For example mine tz boot code is:...".
Title: Re: tzdata
Post by: roberts on December 25, 2009, 06:19:13 PM
Your negative comment aside..
tz was made to be used as boot code as shown by:
http://www.tinycorelinux.com/faq.html#bootcodes
Code: [Select]
tinycore tz=GMT+8                   Timezone tz=PST+8PDT,M4.2.0/2,M11.1.0/2
Your course you can do as you please and ignore its intended use as a boot code.


Title: Re: tzdata
Post by: maro on December 28, 2009, 02:12:12 AM
For those who would like to create their own POSIX TZ string I want to mention a page which once helped me as I needed to adjust my VOIP gateway: http://leaf.sourceforge.net/doc/buci-tz.html
It also contains a link to the "official" reference (which might be better reading for some).

OTOH one could execute "tail -1 FILENAME" where FILENAME is choosen from the files in /usr/local/share/zoneinfo (obviously after installing the tzdata extension at least once).
Title: Re: tzdata
Post by: Jason W on March 11, 2010, 12:25:19 PM
Thanks to robc for an update:

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

Includes tzcode2010c and tzdata2010e.

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
Current: 2010/03/10 Updated to tzcode2010c and tzdata2010e

Title: Re: tzdata
Post by: Jeff W on March 22, 2010, 05:30:31 PM
Forgive my question but I'm an inquisitive idiot.  Is there a method to change the timezone while operating and have it persist without rebooting with tz set as a boot parameter?
Title: Re: tzdata
Post by: gerald_clark on March 22, 2010, 07:19:43 PM
Copy the correct zone file from the the tzdata extension to /etc/localtime.
Add etc/localtime to /opt/.filetool.lst.
Edit .profile, and add 'unset TZ'
Backup
Reboot
Title: Re: tzdata
Post by: Jeff W on March 23, 2010, 10:33:40 AM
Let me be clear.  LOL  Is there a method to change the timezone while operating and have it take the change immediately without requiring a reboot?  I think I understand what changes are necessary to have it persist past reboot. 
Title: Re: tzdata
Post by: curaga on March 23, 2010, 11:29:28 AM
Instead of a reboot, a logout + login would also do.
Title: Re: tzdata
Post by: maro on March 23, 2010, 05: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.
Title: Re: tzdata
Post by: Jeff W on March 29, 2010, 06: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.
Title: Re: tzdata
Post by: Jason W on June 09, 2010, 04: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