Changing time/date in linux

tm37

Lifer
Jan 24, 2001
12,436
1
0
How Do I change the date/ time using command line functions in linux?

I am Running a clark connect box and It doesn't have a way to set the time without shuting it down (BIOS) or using command line functions.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
run date
See what it prints
run date -s "date you want in the format it just printed"
 

tm37

Lifer
Jan 24, 2001
12,436
1
0
ScreenShot

What DO I type EXACTLY?:)

Thsi is really bumming me out all my bandwidth reports have the wrong dates!:(

Thanks
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< ScreenShot

What DO I type EXACTLY?:)

Thsi is really bumming me out all my bandwidth reports have the wrong dates!:(

Thanks
>>



"man date" :D

"date 05092002" is what I would have to type on my home system (OpenBSD). Its probably similar for you. You may need the -s flag, so try "date -s 05092002"
 

manly

Lifer
Jan 25, 2000
13,274
4,051
136
The only problem with date (besides the somewhat cryptic format) is that you might need to use hwclock to make the change permanent after reboot.

That parts easy though:

# hwclock --systohc
 

tm37

Lifer
Jan 24, 2001
12,436
1
0
OK I am now TOTALLY confused.

When I type date -s 05082002 it says-

Invaid date

I get the same error when I type it in wen May 8 23:43:00 CDT 2002
 

tm37

Lifer
Jan 24, 2001
12,436
1
0
GOT IT!

Dropped the WEN part and it worked!



<< Either read the man page or give me root access to the machine >>



DO you really want root acess to my router?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< GOT IT!

Dropped the WEN part and it worked!



<< Either read the man page or give me root access to the machine >>



DO you really want root acess to my router?
>>



Nope, but I thought that option might give you the incentive to check the help ;)

Also, "date --help" should give you some of the options. Upon review, the command I gave you was wrong, that would be how I would change the time not date. I dont think Ive ever changed the date now that I think about it :p
 

tm37

Lifer
Jan 24, 2001
12,436
1
0
I did the Date -help thing But HAD NO IDEA how to make the changes:( Basically I could have been reading it in swahilli and It would have been the same.

The great thing about these forums is I have learned alot by people at least pointing me in the right direction.

Next will be learning to run RPM files!:)

Not tonight though I have an interview tommorow. (NO MENTION OF LINUX ON THE RESUME;))