Solved

Changing the date in terminal

Posted on 2002-03-17
3
643 Views
Last Modified: 2006-11-17
Hi folks, I would like to be able to change the date in a terminal window instead of the gui.
I have tried some of the commands but can't seem to get it to work.
%D Date 11/13/55
Is what I have tried plus a few variations.
Any help, greatly appreciated.
Ned
0
Comment
Question by:Ned_Kelly
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
hindmost earned 25 total points
ID: 6873866
use date with the -s option
to set the date to 17th of march 2002 you would...
date -s 03182002

the format for the string used is MMDDCCYY
Wher M=Month D=Day in Month C=Century Y=Year. (Century is optional. You can add Hour and minute figures to the string as well.

This will only work if you have the appropriate priveleges to set the system clock. Otherwise you'll get an operation not permitted error.
0
 
LVL 2

Expert Comment

by:hindmost
ID: 6873874
Actually that example will set the date to the 18th of march. but all the rest of the info is correct <g>
0
 

Author Comment

by:Ned_Kelly
ID: 6873885
Thanks hindmost, thats great.
Appreciated very much.
Have a great day and regards Ned
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now