Linux command line - How to get and set the date and time of system. |
| Recently, I want to change the system date in linux by using command line. After doing some researches, I get the solutions as stated below: The date command can be used as follows to display the time and date: # date To see UTC/GMT, you can do this: # date –utc The date command also can be used to set the time and date. To set the time manually, do this: # date -s “16:15:00″ If you also need to adjust the date, and not just the time, you can do it like this: # date -s “16:55:30 July 7, 1986″ There is also another way to set the date and time, which is not very pretty: # date 033121422003.55 The above command does not use the -s option, and the fields are arranged like this: MMDDhhmmCCYY.ss Please note that setting the clock with the date command must be done as root. |
No Comments
No comments yet.
RSS feed for comments on this post. TrackBack URI
Leave a comment
You must be logged in to post a comment.

