Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Opensuse 11.1 date command shows:

# date
Wed Dec 23 11:43:27 EST 2009

And I want to change it to current date i.e. July 29 00:50:12 2009. The command I am using to do that is

# date -s "29 July 2009 00:50:12"
Wed July 29 00:50:12 EDT 2009

But as I issue date command, it reverts back to the old value with timezone as EST rather than EDT

# date
Wed Dec 23 11:45:30 EST 2009

Moreover, I could not synchronize HWClock because its giving me following error

# hwclock --debug
hwclock from util-linux-2.12r
hwclock: Open of /dev/rtc failed, errno=19: No such device.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.

The timezone is correctly set in /etc/sysconfig/clock

HWCLOCK="-u"

SYSTOHC="yes"

TIMEZONE="US/Eastern"
DEFAULT_TIMEZONE="US/Eastern"

I don't think there is any NTP server configured as well /etc/ntp.conf

server 127.127.1.0
fudge 127.127.1.0  stratum 10
driftfile /var/lib/ntp/drift/ntp.drift
logfile /var/log/ntp

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

The problem is I've to do everything via shell and also without YaST & YaST2.
Please advice

Edit

sysadmin1138: Thanks.
I started the rcntp.

# rcntp start
Try to get initial date and time via NTP from 0.pool.ntp.org 1.pool.ntdoneg 2.pool.ntp.org  
Starting network time protocol daemon (NTPD)                         done  
# date  
Wed Dec 23 13:05:24 EST 2009

Also I have used the ntpdate

# ntpdate 0.pool.ntp.org  
23 Dec 13:04:01 ntpdate[16408]: step time server 209.123.234.24 offset -12744325.660513 sec

But still the issue has not resolved.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Your NTP service is configured, but you haven't said if it is turned on. The command to see if NTP is turned on is "rcntp status" and will give you rather clear indication if it is turned on or not.

 Checking for network time protocol daemon (NTPD):                    running

Starting it once is as simple as "rcntp start".

Another possible route if ntp is not up is to use the 'ntpdate' command.

 ntpdate 0.pool.ntp.org

That will set the local clock per what that NTP server says. What your 'date' command returns at that point will be diagnostic of further errors. On the other hand, if it is correct, then turning NTP on as a service should keep this server with correct time.

share|improve this answer
add comment

To change the date under Linux you should be Su the write the following:

date mmddhhmmyy 

This for date. For ntp you can check it from yast2. In a xterminal with root permissions (su -) run the tool yast2. Then go to ntp server\clinet configuration.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.