LInux Server Time and Date setting

Posted on 2001-07-10
Last Modified: 2010-04-20
does any one know how to configure the TIme and Date?
as i know, we can easily set it with using linuxconf and under the time and date, but it never shown the Time Zone, my time zone is GMT+800. yet, when i send mail thru my server, the data is early about 5 hours. how come?
please do give me some ideas about this. thank you!
Question by:joelim

Author Comment

ID: 6272107
LVL 51

Expert Comment

ID: 6272577
  date -u
to set the time in the BIOS. Set it to GMT+0, then set your local time using the TZ environment variable in /etc/.profile etc. (also in /etc/rc.config for SuSE).

Accepted Solution

vsamtani earned 100 total points
ID: 6272644
Actually, date -u does not set the BIOS, but simply sets the software clock according to UTC, or Universal Co-ordinated Time.

You may wish to use rdate to set the time by reference to an external machine on the internet which is acting as an accurate time reference. To do this, run (as root):

rdate -s

(An example of a time server in the UK is

This will set the linux software clock. If you also want to set the hardware (BIOS) clock, you should run:

hwclock --systohc

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

LVL 51

Expert Comment

ID: 6273175
oops, date -u does not set the BIOS, it just sets the time for the software clock of the kernel, right. The time in RTC (CMOS) must be set using the BIOS menu. Sorry for confusion.
While booting linux, hwclock is called to set the kernel clock according to the RTC, usually. So it is recommended that the RTC runs in UTC.
Unfortunately this causes problems if you have a multi-boot system, for example linux and M$, 'cause M$ doesn't care about the time, means it sets the RTC to if you change the time using M$'s dialogs :-((

Author Comment

ID: 6275285
how do i set the GMT+800 to my linux redhat server?
i went to /etc/profile, i found nothing but infor about the hostname. how come?
i guess set the time for the software, exspecially the SENDMAIl is good enough. please advice! thanks guys!
LVL 51

Expert Comment

ID: 6276153
as I said before, linux reads the time from the RTC (CMOS clock) while booting and uses it as initial value for the kernels software clock (see man clock, man hwclock).
So you first need to set the RTC using the BIOS.
To modify the kernels software clock use
  date -u
All programs (deamons, application) on UNIX/Linux rely on the software clock and the TZ environment variable.

Expert Comment

ID: 9078751
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Expert Comment

ID: 9978127
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[Insert recommendation here]
Please leave any comments here within the next seven days.
Accept vsamtani's comment as answer.

EE Cleanup Volunteer

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Red Hat Satellite 6.1 how can I set up a PXE boot ? 2 105
Postfix DNS lookups setup 5 43
Linux : how to point the OS to use the new DNS server 11 102
apache and php 3 110
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question