INFORMATICS

The Best

Changing the time linux

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

The document translated automatically

Changing the time linux

How can I change the date and time from the command line? We connect via SSH to a remote server.

If you can not change the time from the command line you can always be done with the X terminal as root.

This komneda is used in linux to change the time or date changes. This can be done only with administrative privileges. 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.

Change of Dates - Linux

Use the following syntax to set new date and time:
date --set = "STRING"

For example, set new date is 2 Oct 2006 6:00:00 p.m., type the command as root Us Help user:
# Date -s "2 OCT 2006 6:00:00 p.m."
OR
# Date --set = "2 OCT 2006 6:00:00 p.m."

You can also simplify format using Help Us syntax:
# Date +% Y% m% d -s "20081128"

Linux Set Time

This set time use the Help Us syntax:
# Date +% T -s "10:13:13"
Where,
10: Hour (hh)
13: Minute (mm)
13: Second (ss)

Use% p locale's equivalent of either AM or PM, enter:
# Date +% T% p -s "6:10:30 AM"
# Date +% T% p -s "12:10:30 PM"

Search