Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have no clue where to look or what to do to change the clock time on my machine. lol.
i had some issues with the kernel losing too many ticks, and now my clock has gone back in time.
can anyone tell me how to change the time?
thanks.
date MMDDhhmm
for example to set system time to 28th December 3:25 PM you would use:
date 12281525
Not exactly sure about Debian sid but if you set your clock to use local hardware clock, do a
hwclock systohc (some distros do it automatically at shutdown)
this will set your bios clock to your system time, therefore next time when your system boots the system will be set correctly
but keep in mind that hardware clock is inaccurate(i think it goes out of sync by few seconds every week, not exactly sure) therefore if possible you're better off syncing system time with the time server everytime it boots(or setup a cron job), then sync the system clock to hardware clock.
h/w the reason I said to use ntp is as Demonbane said, your hardware clock is going to lose/gain time so if you use ntp, eather ntpd or configure ntp and use "ntptimeset -s" in a cron job, you clock will always be spot on.
hey all - thanks for the suggestions.
after looking at the link brew provided, i booted into my win32 partition, and reset the clock (it was in the documentation there). lol.
i'll look at doing it the ntp way once im done with what im working on. thanks again.
I got used to set the time as easy as this on FreeBSD:
date 1400
(which sets the time to 2 pm.)
Linux has the date command, too, so I tried the same, but It did not work: it gave an error "invalid date format" or the like.
I wonder for what the heck it does no longer work on Linux (it worked before!)? Is it a tweak to the date command?
Originally posted by J_Szucs I got used to set the time as easy as this on FreeBSD:
date 1400
(which sets the time to 2 pm.)
Linux has the date command, too, so I tried the same, but It did not work: it gave an error "invalid date format" or the like.
I wonder for what the heck it does no longer work on Linux (it worked before!)? Is it a tweak to the date command?
date MMDDhhmm
So you would do this to set the date to today and 2:00 like mentioned above by demonbane and also an easy 'man date' would have given this as well:
Wow, I see now "man" is much more precious on Linux than on FreeBSD, especially with regard to the date command.
Here is how it accepts parameters on Linux:
MMddhhmmYY.ss
(So the year comes between the minute and the seconds. Thats really tricky, I would have never figured it out.)
And here is how it works on FreeBSD:
YYMMddhhmm.ss
It is a bit more straightforward, isn't it?
Though the problem is not the way they work, but the fact that such a simple command works differently on two unixes. Not very good for someone who uses both.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.