How to set the timezone?

807 views
Skip to first unread message

Rahmat M. Samik-Ibrahim

unread,
Jun 6, 2009, 8:22:08 AM6/6/09
to Milis MINIX
Hi,

May I know how to set the timezone in Minix?
Is there any "/etc/rc.timezone" example available?

regards,

--
Rahmat M. Samik-Ibrahim --- vLSM.org

Giovanni

unread,
Jun 6, 2009, 9:09:15 AM6/6/09
to min...@googlegroups.com
On 06/06/09 14:22, Rahmat M. Samik-Ibrahim wrote:

> May I know how to set the timezone in Minix?
> Is there any "/etc/rc.timezone" example available?

For Central Europe time zone (-1 hour from UTC) I use:

TZ='CET-1CEST,M3.5.0/2,M10.5.0/3'
export TZ

the three fields (separate by commas) means:
CET-1CEST tzone name (CET) offset (-1) summer time name (CEST)
M3.5.0/2 time changes to summer-time on March (M3)
last week (5), on Sunday at 2:00 (0/2)
M10.5.0/3 time changes to regular time on October (M10)
last week (5) on Sunday at 3:00 (0/3)

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
< http://giovanni.homelinux.net/ >

Rahmat M. Samik-Ibrahim

unread,
Jun 6, 2009, 10:55:43 AM6/6/09
to min...@googlegroups.com
Giovanni wrote:

>> May I know how to set the timezone in Minix?
>> Is there any "/etc/rc.timezone" example available?
> For Central Europe time zone (-1 hour from UTC) I use:
> TZ='CET-1CEST,M3.5.0/2,M10.5.0/3'
> export TZ

Thank You!
I have added "export TZ='Etc/GMT+7'" both in
/etc/rc and /etc/profile.
BTW, is "/etc/profile" only, enough?

Unfortunately, it seems that the VMware-server
virtual real time clock is already in localtime.
Any idea how to change that settings?

For the time being, I just adjust the minix clock with
"date -a 25200"

Greg King

unread,
Jun 10, 2009, 3:39:40 AM6/10/09
to minix3
On Jun 6, 10:55 am, "Rahmat M. Samik-Ibrahim" wrote:
> Giovanni wrote:
> >> May I know how to set the timezone in Minix?
> >> Is there any "/etc/rc.timezone" example available?
> > For Central Europe time zone (+1 hour from UTC) I use:
> > TZ='CET-1CEST,M3.5.0/2,M10.5.0/3'
> > export TZ
>
> I have added "export TZ='Etc/GMT+7'" both in
> /etc/rc and /etc/profile.
> BTW, is "/etc/profile" only, enough?

No, "rc" sets the clock; and, "profile" sets your environment.

However, only one or two files need to be adjusted for your time-zone
(the files that I named above read the files that I named below).

On revisions of Minix that are early 3.1.3a and before, you must put a
line, that is similar to the first line that Giovanni described, into
"/etc/rc.timezone" (you don't need the "export" line). Everyone must
be able to read that file (it doesn't need to be executable).

On revisions of Minix that are late 3.1.3a and later, there is a "new"
directory tree: "/usr/share/zoneinfo/". If you have it, then the
line in "/etc/rc.timezone" must be shorter. It is only the part that
comes before the first comma. But, the name that you use must match
one of the path-names in "/usr/share/zoneinfo/".
The second file is a hard-link to the file that you named in "/etc/
rc.timezone". Change to that "zoneinfo/" subdirectory. Then, use
this command:
# ls -i

Notice that the i-node number of "localtime" is the same as the i-node
of "GMT". You must change that! So, using your example:
# cd /usr/share/zoneinfo
# echo Etc/GMT+7 > /etc/rc.timezone
# ln -f Etc/GMT+7 localtime
# reboot

(By the way, "Etc/GMT+7" is a small generic file. Maybe, you should
choose one of the bigger files, in "Asia/" -- "Jakarta", or one of the
three other Indonesian cities in that subdirectory.)

>
> Unfortunately, it seems that the VMware-server
> virtual real time clock is already in localtime.
> Any idea how to change that settings?
>
> For the time being, I just adjust the minix clock with
> "date -a 25200"

After I changed those two files above (especially "localtime") -- and,
re-booted -- VMware's local clock was OK for me. But, if you still
have a problem with it, then these lines might work (I have not tried
them):

# +0700 hours
#rtc.diffFromUTC = +25200
# +0000 hours
rtc.diffFromUTC = +00000

Put them in the .vmx configuration file for your Minix Virtual
Machine.

Greg King

unread,
Jun 10, 2009, 6:44:52 AM6/10/09
to minix3
On Jun 10, 3:39 am, Greg King wrote:
>
> The second file is a hard-link to the file that you named in
> "/etc/rc.timezone".  Change to the "zoneinfo/" subdirectory.
> Then, use this command:
> # ls -i
>
> Notice that the i-node number of "localtime" is the same as the i-node
> of "GMT".  You must change that!  So, using your example:
> # cd /usr/share/zoneinfo
> # echo Etc/GMT+7 > /etc/rc.timezone
> # ln -f Etc/GMT+7 localtime
> # reboot
>
> (By the way, "Etc/GMT+7" is a small generic file.  Maybe, you should
> choose one of the bigger files, in "Asia/" -- "Jakarta", or one of the
> three other Indonesian cities in that subdirectory.)

I forgot to mention two things:

1. A Subversion update might reset the "localtime" file. So, you
should check its i-node number afterwards; and, relink it if
necessary.

2. The text file "/usr/share/zoneinfo/zone.tab" can help people choose
which ZoneInfo file to use.
Reply all
Reply to author
Forward
0 new messages