View previous topic :: View next topic |
Author |
Message |
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 8:43 pm Post subject: Changing Date in Red Hat |
|
|
I'm trying to figure out how to change the date on my Linux box. It has the correct time but the wrong date which pisses me off, I looked in my Linux book and couldn't find anything, please help.
|
|
Back to top |
|
|
GSecur Trusted SF Member
Joined: 30 Sep 2002 Posts: 16777215
|
Posted: Mon Mar 03, 2003 8:53 pm Post subject: |
|
|
use the "date" command from a terminal. I don't remember what the actual syntax is sorry
|
|
Back to top |
|
|
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 8:59 pm Post subject: |
|
|
yeah, I just found it after combing google for 15 minutes.
the syntax for those interested is:
hwlcock --utc --set --date="DD:MM:YYYY HH:mm:ss"
that sets the CMOS clock then you have to set the system clock:
hwclock --hctosys --utc
and that's how you set the time.
|
|
Back to top |
|
|
blueminder Just Arrived
Joined: 15 Feb 2003 Posts: 0 Location: South Florida
|
Posted: Mon Mar 03, 2003 9:19 pm Post subject: |
|
|
For changing the date in Linux, if you want the time to be accurate, I highly recommend using ntpdate which can be found at http://www.eecis.udel.edu/~ntp/ .
when you point ntpdate to a time server, it will automatically correct your time and date.
just run a simple:
Code: |
ntpdate tick.usno.navy.mil |
and your time is set correct and all!
|
|
Back to top |
|
|
GSecur Trusted SF Member
Joined: 30 Sep 2002 Posts: 16777215
|
Posted: Mon Mar 03, 2003 9:21 pm Post subject: |
|
|
I had always wondered how well that function worked. If you lose connection to the Timeserver does it just skip the update or does it give you an error?
|
|
Back to top |
|
|
blueminder Just Arrived
Joined: 15 Feb 2003 Posts: 0 Location: South Florida
|
Posted: Mon Mar 03, 2003 9:23 pm Post subject: |
|
|
GSecur wrote: |
I had always wondered how well that function worked. If you lose connection to the Timeserver does it just skip the update or does it give you an error? |
I think all it does is sync your time and disconnect. You can resync whenever you want I believe, it shouldn't matter whether or not you're online all the time.
|
|
Back to top |
|
|
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 9:25 pm Post subject: |
|
|
blueminder wrote: |
For changing the date in Linux, if you want the time to be accurate, I highly recommend using ntpdate which can be found at http://www.eecis.udel.edu/~ntp/ .
when you point ntpdate to a time server, it will automatically correct your time and date.
just run a simple:
Code: |
ntpdate tick.usno.navy.mil |
and your time is set correct and all! |
Is that the correct server?
|
|
Back to top |
|
|
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 9:29 pm Post subject: |
|
|
you have to run the daemon also. That autmatically syncs the clock to the server's clock that you specify.
|
|
Back to top |
|
|
blueminder Just Arrived
Joined: 15 Feb 2003 Posts: 0 Location: South Florida
|
Posted: Mon Mar 03, 2003 9:36 pm Post subject: |
|
|
myhatisred wrote: |
Is that the correct server? |
Yes, I believe so.
I got it off of a Public NTP server list here: http://www.eecis.udel.edu/~mills/ntp/clock1a.html
And about the daemon, I never really tried running it, though I may consider it, I've only really used the ntpdate part of the distribution.
|
|
Back to top |
|
|
ShaolinTiger Forum Fanatic
Joined: 18 Apr 2002 Posts: 16777215 Location: Kuala Lumpur, Malaysia
|
Posted: Mon Mar 03, 2003 10:05 pm Post subject: |
|
|
I always use ntp, how else do you people keep your LAN's in sync?
Run ntp on one linux box as a cron job every hour and the daemon, then net time linuxbox /set /y in the login script of every win machine.
There is a list of public servers above as blueminder said
|
|
Back to top |
|
|
nexus Just Arrived
Joined: 22 Feb 2003 Posts: 0 Location: /proc
|
Posted: Mon Mar 03, 2003 11:12 pm Post subject: |
|
|
hehe this is one of those times when unix/linux can be a little user unfriendly. You use command date with parameters:
date MMDDhhmmYYYY.ss
for example:
[root@cloudnine root]# date 030322002003.12
Mon Mar 3 22:00:12 CET 2003
|
|
Back to top |
|
|
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 11:18 pm Post subject: |
|
|
ntp is better I think, after today I don't think I would ever manually set the date/time again but thanx for the syntax anyways
|
|
Back to top |
|
|
myhatisred Just Arrived
Joined: 11 Jan 2003 Posts: 0
|
Posted: Mon Mar 03, 2003 11:30 pm Post subject: |
|
|
ShaolinTiger wrote: |
I always use ntp, how else do you people keep your LAN's in sync?
Run ntp on one linux box as a cron job every hour and the daemon, then net time linuxbox /set /y in the login script of every win machine.
There is a list of public servers above as blueminder said |
the only thing that i'm still having problems w/ is setting the time on the win boxes. I use the following syntax: net time 192.168.0.3 /set
and all i get is the correct syntax of the command which is:
NET TIME [\\computername | /DOMAIN[:domainname] | /RTSDOMAIN:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]
please help
|
|
Back to top |
|
|
|