LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Changing date permanently (https://www.linuxquestions.org/questions/red-hat-31/changing-date-permanently-4175578759/)

anon076 05-01-2016 12:02 PM

Changing date permanently
 
Is there a way to change the date permanently that's different than the actual date?
I need to change the date and the system needs to keep the changed date during the testing period.

I tried changing the month for testing but it eventually changes back to the current month on its own. The ntpd is off.

Emerson 05-01-2016 12:06 PM

Linux does not do it, but the desktop environment you are running on Linux may. (Another reason not to run bloated DE's.) It probably runs hwclock utility and gets the time from BIOS. Workaround - change BIOS time.

michaelk 05-01-2016 04:46 PM

What version of Red Hat are you running?

How long is the testing period? Is the computer running continuously? Do you need to keep the month and day the same?
Do you know how long it will take before the date jumps back? I am not aware that the BIOS clock is read other then at boot up.

Emerson 05-01-2016 04:53 PM

You can test it, after setting clock with date utility follow up with hwclock -w and see if it still acts up. If it does there may be some reason ntpdate is run.

anon076 05-02-2016 12:04 PM

Is the hwclock the same as the BIOS clock?
After changing the date using the date utility, after about 30 minutes, it changes back to the current time.
ntpd is not running.
But the hwclock shows the changed time that was set using the date utility.
So I just have it sync with hwclock and it keeps the changed time.

The RedHat version is 5.11. It's on continuously. I just need to have the month set to the previous month.

michaelk 05-02-2016 12:24 PM

hwclock is the same as the BIOS clock.

There could be some cron job setup as root or system that sets time using ntpdate. There are other methods to update time like rdate but doubt they are being used.

Emerson 05-02-2016 12:48 PM

Quote:

Originally Posted by linuxdistro (Post 5539573)
But the hwclock shows the changed time that was set using the date utility.

This is weird, date utility should not touch the hwclock. I suspect there is some GUI applet running doing all this mess.

Doug G 05-02-2016 03:43 PM

Also check that chrony isn't running. chrony is somehow installed and running as a service on Fedora 23, and I don't recall installing it myself

anon076 05-03-2016 12:18 AM

Thanks guys. The workaround I have in place seems to do the job.


All times are GMT -5. The time now is 07:29 AM.