• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Changing Date in Red Hat

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux

View previous topic :: View next topic  
Author Message
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 8:43 pm    Post subject: Changing Date in Red Hat Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
GSecur
Trusted SF Member
Trusted SF Member


Joined: 30 Sep 2002
Posts: 16777215


Offline

PostPosted: Mon Mar 03, 2003 8:53 pm    Post subject: Reply with quote

use the "date" command from a terminal. I don't remember what the actual syntax is sorry Sad
Back to top
View user's profile Send private message Send e-mail Visit poster's website
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
blueminder
Just Arrived
Just Arrived


Joined: 15 Feb 2003
Posts: 0
Location: South Florida

Offline

PostPosted: Mon Mar 03, 2003 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
GSecur
Trusted SF Member
Trusted SF Member


Joined: 30 Sep 2002
Posts: 16777215


Offline

PostPosted: Mon Mar 03, 2003 9:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
blueminder
Just Arrived
Just Arrived


Joined: 15 Feb 2003
Posts: 0
Location: South Florida

Offline

PostPosted: Mon Mar 03, 2003 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 9:29 pm    Post subject: Reply with quote

you have to run the daemon also. That autmatically syncs the clock to the server's clock that you specify.
Back to top
View user's profile Send private message Visit poster's website AIM Address
blueminder
Just Arrived
Just Arrived


Joined: 15 Feb 2003
Posts: 0
Location: South Florida

Offline

PostPosted: Mon Mar 03, 2003 9:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Mon Mar 03, 2003 10:05 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Visit poster's website
nexus
Just Arrived
Just Arrived


Joined: 22 Feb 2003
Posts: 0
Location: /proc

Offline

PostPosted: Mon Mar 03, 2003 11:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 11:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
myhatisred
Just Arrived
Just Arrived


Joined: 11 Jan 2003
Posts: 0


Offline

PostPosted: Mon Mar 03, 2003 11:30 pm    Post subject: Reply with quote

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 Smile


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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register