WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Time Zone in TinyCore, either local time or UTC  (Read 14123 times)

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Time Zone in TinyCore, either local time or UTC
« 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

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: Time Zone in TinyCore, either local time or UTC
« Reply #1 on: June 20, 2013, 12:32:05 PM »
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.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Time Zone in TinyCore, either local time or UTC
« Reply #2 on: June 21, 2013, 12:30:42 AM »
That's interesting,  I append only "  tz=GMT+8 "  to the boot command line which appears to be satisfactory, we need more than that?

« Last Edit: June 21, 2013, 01:53:27 AM by coreplayer2 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Time Zone in TinyCore, either local time or UTC
« Reply #3 on: June 21, 2013, 12:40:57 AM »
That's fine, but requires manual change to summertime and back each year, while the method in Reply #1 is "set and forget" ;).
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Time Zone in TinyCore, either local time or UTC
« Reply #4 on: June 21, 2013, 01:01:32 AM »
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?
« Last Edit: June 21, 2013, 01:12:06 AM by coreplayer2 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Time Zone in TinyCore, either local time or UTC
« Reply #5 on: June 21, 2013, 02:25:33 AM »
You could possibly do something like:

Code: [Select]
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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Time Zone in TinyCore, either local time or UTC
« Reply #6 on: June 21, 2013, 03:42:05 AM »
@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 :-)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Time Zone in TinyCore, either local time or UTC
« Reply #7 on: June 21, 2013, 09:38:27 AM »
Use ntpclient to set the time.

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Time Zone in TinyCore, either local time or UTC
« Reply #8 on: June 21, 2013, 09:43:03 AM »
@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.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Time Zone in TinyCore, either local time or UTC
« Reply #9 on: June 21, 2013, 04:45:16 PM »
Or 'rdate' alternatively.
« Last Edit: June 21, 2013, 05:50:33 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: Time Zone in TinyCore, either local time or UTC
« Reply #10 on: June 21, 2013, 06:37:58 PM »
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).

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Time Zone in TinyCore, either local time or UTC
« Reply #11 on: June 22, 2013, 01:31:29 AM »
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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: Time Zone in TinyCore, either local time or UTC
« Reply #12 on: June 23, 2013, 07:53:31 AM »
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.