How to change Date, Time , Zone on linux server
You have to use date command to display the current date and time or set the system date / time over ssh session.
# date
Tue May 11 22:27:44 CET 2010
Set Date:
Use the following syntax to set new data and time:
[HTML]date set="STRING"[/HTML]
example
#date -s "2 June 2010 18:00:00"
Set Time:
To set time use the following syntax:
# date +%T -s "05:10:15"
Where,
* 05: Hour (hh)
* 10: Minute (mm)
* 15: Second (ss)
To change timezone
The file /etc /localtime, is a link to or copy of a file containing information about your time zone. The Zone information files located in /usr/share/zoneinfo this depends on your distribution.
[HTML]
cd /etc/
ln -sf /usr/share/zoneinfo/EST localtime
[/HTML]
If youwish to set up it to IST (Asia/Calcutta):
ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
You have to use date command to display the current date and time or set the system date / time over ssh session.
# date
Tue May 11 22:27:44 CET 2010
Set Date:
Use the following syntax to set new data and time:
[HTML]date set="STRING"[/HTML]
example
#date -s "2 June 2010 18:00:00"
Set Time:
To set time use the following syntax:
# date +%T -s "05:10:15"
Where,
* 05: Hour (hh)
* 10: Minute (mm)
* 15: Second (ss)
To change timezone
The file /etc /localtime, is a link to or copy of a file containing information about your time zone. The Zone information files located in /usr/share/zoneinfo this depends on your distribution.
[HTML]
cd /etc/
ln -sf /usr/share/zoneinfo/EST localtime
[/HTML]
If youwish to set up it to IST (Asia/Calcutta):
ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
No comments:
Post a Comment