• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

Changing the date in terminal

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
Ned_Kelly
Asked:
Ned_Kelly
  • 2
1 Solution
 
hindmostCommented:
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
 
hindmostCommented:
Actually that example will set the date to the 18th of march. but all the rest of the info is correct <g>
0
 
Ned_KellyAuthor Commented:
Thanks hindmost, thats great.
Appreciated very much.
Have a great day and regards Ned
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now