User`s manual
UC-8410/8416/8418-LX User’s Manual Managing Embedded Linux
3-9
Setting the System Time
There are two ways to support the timezone configuration on a Moxa embedded computer. One is
using the TZ variable. The other is using /etc/localtime.
TZ variable
If you would like to use TZ variable, link to the following URL for all configurations and settings.
http://www.mkssoftware.com/docs/man5/timezone.5.asp
/etc/timezone
The local timezone is stored in /etc/localtime and is used by GNU Library for C (glibc) if the TZ
environment variable is not set. This file is either a copy of /usr/share/zoneinfo/ tree or a symbolic
link to it.
The UC-8410/8416/8418 does not provide /usr/share/zoneinfo/ files, so you need to copy a time
zone information file to the UC-8410/8416/8418 and write over the original local time file.
1. The /usr/share/zoneinfo folder on a PC that is running standard Linux contains several time
zone information files.
2. Copy the time zone file that you want to use to the UC-8410/8416/8418 to overwrite the
original /etc/localtime file.
3. Type a date to check if the new time zone appears.
Adjusting the System Time
Setting the Time Manually
The UC-8410/8416/8418 has two time settings. One is the system time, and the other is the RTC
(Real Time Clock) time kept by the UC-8410/8416/8418’s hardware. Use the #date command to
query the current system time or set a new system time. Use #hwclock to query the current RTC
time or set a new RTC time.
Use the following command to query the system time:
#date
Use the following command to query the RTC time:
#hwclock
Use the following command to set the system time:
#date MMDDhhmmYYYY
MM = Month
DD = Date
hhmm = hour and minute
YYYY = Year
Use the following command to set the RTC time:
#hwclock –w
Write current system time to RTC