Time Setting In ubuntu (hardware time, system time, local time), ubuntu hardware
The cause of the problem is:
In cron, the task is set to be executed at a.m.. When checking logs, it is found that the time is always incorrect. It is executed at around a.m. The study found that the task was executed at local time, but I do not know why the time in syslog is utc time.
Here, the concepts of hardware time, system time, and local time are involved. The following are some command operations involved:
How to set the time zone:
Http://blog.sina.com.cn/s/blog_6c9d65a1010145st.html
1. sudo tzselect
Ii. copy the file to sudo cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime In The/etc directory. III. Update Time: sudo ntpdate time.windows.com check time:
Pwsync @ wepingwest:/etc/default $ date
Thu Apr 2 12:26:33 CST 2015
Pwsync @ wepingwest:/etc/default $ date-u
Thu Apr 2 04:26:55 UTC 2015
Pwsync @ wepingwest:/etc/default $ date-R
Thu, 02 Apr 2015 12:27:16 + 0800
Hardware time:
Pwsync @ wepingwest:/etc/default $ sudo hwclock -- show
Thu 02 Apr 2015 12:27:42 pm cst-0.317712 seconds
The hardware time is also localtime.
Finally, in order to display the local time in syslog and other logs, You Need To Set utc to no in/etc/default/rcS (the system needs to be restarted)
To save the system time on hardware
# Hwclock -- systohc
Http://blog.chinaunix.net/uid-26495963-id-3048079.html)
Http://www.111cn.net/sys/linux/58514.htm)