Solved

LInux Server Time and Date setting

Posted on 2001-07-10
9
359 Views
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!
0
Comment
Question by:joelim
9 Comments
 

Author Comment

by:joelim
ID: 6272107
tq
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6272577
use
  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).
0
 
LVL 5

Accepted Solution

by:
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 name.of.time.server.net

(An example of a time server in the UK is ntp.demon.co.uk)

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

hwclock --systohc

Vijay
0
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

by:ahoffmann
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 :-((
0
 

Author Comment

by:joelim
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!
0
 
LVL 51

Expert Comment

by:ahoffmann
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.
0
 

Expert Comment

by:CleanupPing
ID: 9078751
joelim:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:troopern
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.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

troopern
EE Cleanup Volunteer
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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