Setting the system date and clock

To set the system clock, use the date command.

For Redhat Systems, use the following format:

date --set="Mmm DD HH:MM:SS YYYY"

Example:

date --set="Oct 20 15:52:29 2004"



For FreeBSD systems, use the following format:

date YYMMDDHHMM

Example:

date 0410201544

Will set the date/time to 2004, October 20th, 15:44 (3:44pm).

For any operating system, if you have the rdate program, you can simply type:

rdate -s rdate.directadmin.com

to sync your server with the atomic clock in Boulder, Colorado.  Note that if the value set by rdate isn't correct, then you likely have a wrong timezone specified.   Commands like system-config-date or redhat-config-date can set it up for you.  Else you'd need to create a symbolic link from one of the timezones in /usr/shared/zoneinfo to /etc/localtime, eg:

mv /etc/localtime /etc/localtime.moved
ln -s /usr/share/zoneinfo/Canada/Mountain /etc/localtime




You should also update your php.ini to use the correct timezone.
Edit the value:

date.timezone = "UTC"

and change UTC to one of the valid timezone's that php can accept/
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to use SSH

SSH is a tool used to connect to your server.   This is how 95% of your system is setup.To...

Linux Command Line Cheat Sheet

Moving Around the FilesystemCommands for moving around the filesystem include the following....

What are some basic commands that I need to know to use Linux?

If you are new to shell (SSH), below are some commands to get you started. A full list of shell...

Basic Commands for Services

IPTABLES To check firewall rule set using iptables:iptables -L To Flush/Clear the firewall...

How can I check the number connections to a port from an IP?

While logged into your server via SSH as root you can run the following command: netstat...

Powered by WHMCompleteSolution