Tiny Core Linux
Tiny Core Base => TCB Tips & Tricks => Topic started by: theYinYeti on June 20, 2013, 04:17:20 AM
-
I had some trouble setting the time zone, but finally managed to do it. In case others are interested, I wrote down my notes on the subject:
http://yeti.selfip.net/cms/index.php/post/2013/06/20/Time-zone-in-TinyCore-Linux
-
http://www.tinycorelinux.net/faq.html#bootcodes
I typically use "tz=EST+5EDT,M3.2.0/2,M11.1.0/2". I'm surprised you didn't copy the contents here also.
-
That's interesting, I append only " tz=GMT+8 " to the boot command line which appears to be satisfactory, we need more than that?
-
That's fine, but requires manual change to summertime and back each year, while the method in Reply #1 is "set and forget" ;).
-
Actually I didn't realize it was a set and forget deal. I think it's always interesting to see another method, Isn't there also a tc script to accomplish this?
-
You could possibly do something like:
TZ=EST+5EDT,M3.2.0/2,M11.1.0/2
export TZ
Not sure where would be the most suitable to set that, possibly in /etc/profile.
-
@genec: While your TZ value is perfectly valid, in my opinion, one shouldn’t have to deal with this level of detail. The pre-defined timezones are here for this purpose. What I did basically comes down to the same result… almost.
@coreplayer2: As tinypoodle said, DST is an issue in some parts of the world :-) Apart from that, there’s also the problem that my TinyCore install is portable (on USB flash drive) and has to be able to boot on computers with local time or UTC time in their clock; hence the additional optional “noutc” boot parameter.
See this link if you’re interested in the subject:
http://forum.tinycorelinux.net/index.php/topic,5017.msg27012.html#msg27012
All in all, I just wanted to set the time zone in the cleanest way possible, given that I do not want to change the host clock, and I have to adapt to it :-)
-
Use ntpclient to set the time.
-
@gerald_clark: Yes, you’re right. When NTP is an option, it is way better than calling “hwclock -s”. Unfortunately, I often have to work in companies where the admins have a weird definition of security, and NTP wouldn’t work :-( Most of the time (if not always), hwclock does the trick.
-
Or 'rdate' alternatively.
-
In my opinion, it's a choice: use a complex TZ parameter or require another extension. My take on the goal of Core/TinyCore is keep it as small as can still be function but have options (TCZs/SCMs).
-
In my opinion, it's a choice: use a complex TZ parameter or require another extension.
I came to highly value the former for its portability.
Once I had figured out my TZ value under Core, I then found I could apply the same:
1. On systems beyond Linux.
2. On user account without having any elevation of privileges to override systemwide TZ.
3. Within an already running instance of an app to override TZ under which it was started.
-
An added bonus of the TZ parameter: When someone decides to change Daylight Saving Time/Summer Time rules for beginning/ending dates (which has happened a bit in about the last 7 years), you don't have to wait for the updated extension if you understand its syntax or know where to get the latest version for you locale.