LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   centOS change month (https://www.linuxquestions.org/questions/linux-newbie-8/centos-change-month-4175415033/)

conflicker 07-05-2012 06:35 AM

centOS change month
 
Hi, any idea on how to change the month of my server,
the date -s command is need to change m/d/y h:m:s which I don't want to do.

my server is centOS 6..

Thanks..

Satyaveer Arya 07-05-2012 08:11 AM

But the month can be changed with the same command as well.
You do one thing, put the same date and year while changing the month and just change the month according to your need.
One of the examples for changing the date is as follows:

Quote:

# date -s "5 Jul 2012 18:00:00"
So, as shown above in the example, you can just change the month there according to your requirement.

greenboysd 07-05-2012 08:42 AM

you can use this cmd date --set="STRING" or --reference=FILE

conflicker 07-05-2012 08:46 AM

Quote:

Originally Posted by greenboysd (Post 4719903)
you can use this cmd date --set="STRING" or --reference=FILE

Any idea what this error means?
Quote:

date: cannot set date: Operation not permitted

Nylex 07-05-2012 09:25 AM

To set the date, you need to be root.

Satyaveer Arya 07-05-2012 09:54 AM

Quote:

Any idea what this error means?
Show us the command you executed.

conflicker 07-05-2012 11:36 AM

Quote:

Originally Posted by Nylex (Post 4719945)
To set the date, you need to be root.

Here is the command that I execute:
Quote:

date --set="5 JUL 2012 13:44:30"
I already logged as root..

greenboysd 07-09-2012 12:31 AM

It should be working.

[root@host1]# date
Mon Jul 9 10:59:29 IST 2012
[root@host1]# date --set="5 JUL 2012 13:44:30"
Thu Jul 5 13:44:30 IST 2012
[root@host1]# date
Thu Jul 5 13:44:33 IST 2012
[root@bost1]#


All times are GMT -5. The time now is 09:15 PM.