NTP - date and time

Synchronize date and time

Installation

  • Synchronize date and time between the physical machine and the VMs running on your system:
    # apt-get update
    # apt-get install ntp
  • Check whether the correct date and time, and the connection to a time server, has been established:
    # date
    # ntpq -p

Troubleshooting

  • If you run ntpq -p and you get
    No association ID's returned
  • Run
    # dpkg-reconfigure ntp
  • And then again
    # ntpq -p

Change the timezone of your linux box

# dpkg-reconfigure tzdata

You need to restart the apache2 service for php to recognize the changed timezone.