LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-05-2012, 06:35 AM   #1
conflicker
Member
 
Registered: Sep 2011
Posts: 92

Rep: Reputation: Disabled
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..
 
Old 07-05-2012, 08:11 AM   #2
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
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.
 
Old 07-05-2012, 08:42 AM   #3
greenboysd
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
you can use this cmd date --set="STRING" or --reference=FILE
 
Old 07-05-2012, 08:46 AM   #4
conflicker
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by greenboysd View Post
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
 
Old 07-05-2012, 09:25 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
To set the date, you need to be root.
 
Old 07-05-2012, 09:54 AM   #6
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Quote:
Any idea what this error means?
Show us the command you executed.
 
Old 07-05-2012, 11:36 AM   #7
conflicker
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Nylex View Post
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..
 
Old 07-09-2012, 12:31 AM   #8
greenboysd
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
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]#
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsnapshot - missing last month on a 3-month cycle. Fedora 15 steve_s Linux - Software 2 02-17-2012 04:51 AM
HOWTO: Make a repetitive job that reminds you to change your password every month drManhattan Ubuntu 2 09-05-2010 10:55 AM
LXer: CodeWeavers CEO names himself employee of the month for 175TH consecutive month LXer Syndicated Linux News 3 08-13-2010 04:55 PM
Korganizer month view skipping ahead; can I change behavior? mikerez Linux - Desktop 1 12-14-2009 02:22 AM
limit CentOS with lighttpd bandwidth to 4TB/month ryan1414 Linux - Server 1 09-20-2009 11:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration