h1

How can I set the system date and time from the command prompt (bash shell)?

May 1, 2008

Use date command to display the current date and time or set the system date and time over ssh session.
This is useful if the Linux server time and/or date is wrong, and you need to set it to new values from the shell prompt.
Use the following syntax to set new data and time:

date set=”STRING”

For example, set new data to 2 Oct 2006 18:00:00, type the following command as root user:

# date -s “2 OCT 2006 18:00:00”

Source http://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: