Set Time & Date

Cyber-DL

Verified User
Joined
Jun 21, 2008
Messages
48
Hi ,

i want set date & time to correct date & time ,

i'm from IRAN , and in iran time is : 21:06:00 , and date is Nov 27 ,2009
but my vps time is

Code:
-bash-3.2# date
Sat Nov 28 19:31:18 GMT 2009

i followed this :
Code:
http://help.directadmin.com/item.php?id=52

i used this commands :
Code:
mv /etc/localtime /etc/localtime.moved
ln -s /usr/share/zoneinfo/Iran /etc/localtime

but it's not correct date & time , i was trying with date command but it's won't work ,

look at this :
Code:
-bash-3.2# date --set="Nov 27 21:03:00 2009"
Fri Nov 27 21:03:00 GMT 2009
-bash-3.2# date
Sat Nov 28 19:31:18 GMT 2009

there is no error but date command wont work ,

Note : My ****ing and damn Prisident change the date & time many many time so all of zones is incorrect

NOW day must be set to 27 , and time must be set to 21:11 PM , so how can i do this ? how can i set date & time manualy ?

Best Regards
 
You should check with your OS distribution maintainers to see if they have an updated file for Iran. The file needs to be updated whenever the country changes how it sets it's time.

Setting time to GMT is what a lot of server admins to simply to avoid these issues and to make it easier to check email, etc., across the 'net.

Is there a reason you cannot just use GMT?

Jeff
 
i use the package ntpdate with a crontab like this

0 1 * * * /usr/sbin/ntpdate -b time.ien.it >/dev/null 2>&1

so each night at 1am he check the right time form server time.ien.it, you should use a different one for iran but maybe is not needed.

Regards
 
ntpdate (as well as the daemon) will only work in conjunction with the correct localtime file.

The OP's problem appears to be that he can not get an up-to-date localtime file.

Jeff
 
Back
Top