However, your current date is not synchronized yet, you will have to activate the NTP service in order for it to synchronize.īy default, if you are working with a distribution with systemd, you should have the systemd-timesync daemon by default. In order to check your current system date, you have to run the timedatectl command again. $ timedatectl set-timezone America/New_York To set the timezone, use the “ set-timezone” command. To set your timezone to New York, you can search for it easily using grep. $ timedatectl list-timezonesĪs you can see, timezones are presented using the following syntax : continent/region. To list timezones on Linux, use the “ list-timezones” option with timedatectl. In order to consult your current timezone on Linux, you can run the timedatectl command. If your timezone is badly configured, you will need to modify your timezone information. If you don’t use the NTP protocol (with ntpd or chrony), your system will use the timesync service by default. To set the date, you need to set your timezone information and to (optionally) activate the NTP protocol in order for your system to synchronize with NTP servers. Whether you are working on Debian/Ubuntu or on RHEL/CentOS, the way to set the date is the same. If you don’t have sudo privileges on your account, follow this tutorial to get sudo on Debian based systems, or on Red Hat based systems (CentOS, RHEL) Set date on Linux using timedatectl User user may run the following commands on localhost: To make sure of it, you can run the following command $ sudo -l Synchronize your hardware clock with your system dateīefore starting, you will need to have sudo privileges on your host in order to perform some of the commands.Set date on Linux using the date command.
0 Comments
Leave a Reply. |