Search

Wednesday, May 6, 2009

how to set time and date in linux debian ?

Setting the new date time and timezone in Debian Linux is quite tricky compared to that of windows operating system as changing timezone and time involves some manual work around recently timezone and time of Debian system in office changed for some weird reason but could not able to change it easily until some R&D done!!! below are the steps on how to change date, time and timezone settings Setting time and date

To query current time and date on your Linux system use the following command on terminal

debian:~# date

To set the time and date use the following commands

debian:~# date --set 2009-1-02
debian:~# date --set 12:28:0

debian linux allows to interactively set the time zone just type this /usr/bin/tzselect command on terminal as show below

debian:~# /usr/bin/tzselect

Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#?5

because i live in india that in asian continent i selected 5 above now you will get the list as show below

Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea (North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) Sri Lanka
8) Cambodia 25) Kyrgyzstan 42) Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27) Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29) Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) United Arab Emirates
14) India 31) Myanmar (Burma) 48) Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
#?14


The following information has been given:

India

Therefore TZ='Asia/Kolkata' will be used.
Local time is now: Wed May 6 14:36:28 IST 2009.
Universal Time is now: Wed May 6 09:06:28 UTC 2009.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
TZ='Asia/Kolkata'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you can use the /usr/bin/tzselect command in shell scripts:
Asia/Kolkata

so as said above just open the .profile file in your home directory and enter the line as said above and restart or log off and log on your system now your time,date and timezone should be set appropriately..

if the above steps does not work for you please leave a comment so that we can check and update the above guide if you know any other method which is still simple you are welcomed

0 comments:

Post a Comment

Other Interesting Articles



Related Article Widget by Yogith

Search Powered by Google