
UC-8100-LX Software
Getting Started
2-10
YYYY = Year
moxa@Moxa:~$ sudo date 071123192014
Mon Jul 11 23:19:00 UTC 2014
Use the following command to set the RTC time to system time:
moxa@Moxa:~$ sudo hwclock –w
moxa@Moxa:~$ sudo hwclock
Fri 11 Jul 2014 11:19:38 PM UTC -1.006862 seconds
NOTE
Click the following links for more information on Datetime.
https://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
https://wiki.debian.org/DateTime
67B
Setting the Time Zone
There are two ways for supporting the timezone configuration on Moxa embedded computer. One is using the
TZ variable. The other is using /etc/localtime.
TZ variable
TZ environment variable format looks like this:
TZ=standardHH[:MM[:SS]][daylight[HH[:MM[:SS]]][,start date[/starttime], enddate[/endtime]]]
Here are some possible settings for the North American Eastern time zone:
TZ=EST5EDT
TZ=EST0EDT
TZ=EST0
In the first case, the reference time is GMT and thus stored time values are correct world wide. A simple change
of the TZ variable prints local time correctly, anywhere. In the second case, the reference time is Eastern
Standard Time and the only conversion performed is for Daylight Saving Time. Therefore, there is no need to
adjust the hardware clock for Daylight Saving Time twice per year. In the third case, the reference time is
always the time reported. This is suggested if the hardware clock on your machine automatically adjusts for
Daylight Saving Time or you insist on manually resetting the hardware time twice a year.
Adding in the file /etc/rc.d/rc.local, the timezone setting will be activated after the computer restarts.
moxa@Moxa:~$ export TZ=
EST0
Following are other possible values for the TZ environment variable:
Hours From Greenwich Mean Time (GMT)
Value
Description
0
GMT
Greenwich Mean Time
+1
ECT
European Central Time
+2
EET
European Eastern Time
+2
ART
+3
EAT
Saudi Arabia
+3.5
MET
Iran
+4
NET
+5
PLT
West Asia
+5.5
IST
India
+6
BST
Central Asia
+7
VST
Bangkok
+8
CTT
China
+9
JST
Japan
+9.5
ACT
Central Australia