How to change ubuntu's server date and time via command line? The Next CEO of Stack...

RigExpert AA-35 - Interpreting The Information

Which one is the true statement?

Does Germany produce more waste than the US?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Math-accent symbol over parentheses enclosing accented symbol (amsmath)

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Unclear about dynamic binding

Is there always a complete, orthogonal set of unitary matrices?

What is the value of α and β in a triangle?

How to avoid supervisors with prejudiced views?

Why does the flight controls check come before arming the autobrake on the A320?

Is micro rebar a better way to reinforce concrete than rebar?

Is wanting to ask what to write an indication that you need to change your story?

I want to delete every two lines after 3rd lines in file contain very large number of lines :

Why do remote US companies require working in the US?

0 rank tensor vs 1D vector

What does "Its cash flow is deeply negative" mean?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

How do I align (1) and (2)?

What was the first Unix version to run on a microcomputer?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Solving system of ODEs with extra parameter

Writing differences on a blackboard

Reference request: Grassmannian and Plucker coordinates in type B, C, D



How to change ubuntu's server date and time via command line?



The Next CEO of Stack OverflowWhat is the command to update time and date from internetChanging server datedate wouldn't change from consoleHow to change Date/Time format to English?How to make Ubuntu show date AND time on Files screen?Standard user can change the Date and TimeHow to change the date/time format to English, while preserving my own country's regional settings?How often is the time/date updated automatically?Date sets itself ahead 3 daysChange the time format for good on ubuntu serverHow to change Date & Time format with LubuntuDate off by years - Cannot set dateAutomatically Sync system time from hwclock once a day












30















The Ubuntu server's current date and time is different from the time zone date and time. I have tried using:



sudo date "30 Sep 2015 4:43:42"


to change it but it did not change the date and time, just printed on terminal the date and time I changed, but when I executed:



sudo hwclock --show


The date and time is still the old one.



What is the correct way to change date and time of Ubuntu Server?










share|improve this question

























  • you really typed "sudo date newdate" - the word "newdate"?

    – Wolfgang
    Sep 30 '15 at 7:54








  • 1





    Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

    – Priska Aprilia
    Sep 30 '15 at 7:56
















30















The Ubuntu server's current date and time is different from the time zone date and time. I have tried using:



sudo date "30 Sep 2015 4:43:42"


to change it but it did not change the date and time, just printed on terminal the date and time I changed, but when I executed:



sudo hwclock --show


The date and time is still the old one.



What is the correct way to change date and time of Ubuntu Server?










share|improve this question

























  • you really typed "sudo date newdate" - the word "newdate"?

    – Wolfgang
    Sep 30 '15 at 7:54








  • 1





    Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

    – Priska Aprilia
    Sep 30 '15 at 7:56














30












30








30


15






The Ubuntu server's current date and time is different from the time zone date and time. I have tried using:



sudo date "30 Sep 2015 4:43:42"


to change it but it did not change the date and time, just printed on terminal the date and time I changed, but when I executed:



sudo hwclock --show


The date and time is still the old one.



What is the correct way to change date and time of Ubuntu Server?










share|improve this question
















The Ubuntu server's current date and time is different from the time zone date and time. I have tried using:



sudo date "30 Sep 2015 4:43:42"


to change it but it did not change the date and time, just printed on terminal the date and time I changed, but when I executed:



sudo hwclock --show


The date and time is still the old one.



What is the correct way to change date and time of Ubuntu Server?







command-line server time date






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 30 '15 at 8:14









chaos

19.8k85968




19.8k85968










asked Sep 30 '15 at 7:51









Priska ApriliaPriska Aprilia

253137




253137













  • you really typed "sudo date newdate" - the word "newdate"?

    – Wolfgang
    Sep 30 '15 at 7:54








  • 1





    Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

    – Priska Aprilia
    Sep 30 '15 at 7:56



















  • you really typed "sudo date newdate" - the word "newdate"?

    – Wolfgang
    Sep 30 '15 at 7:54








  • 1





    Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

    – Priska Aprilia
    Sep 30 '15 at 7:56

















you really typed "sudo date newdate" - the word "newdate"?

– Wolfgang
Sep 30 '15 at 7:54







you really typed "sudo date newdate" - the word "newdate"?

– Wolfgang
Sep 30 '15 at 7:54






1




1





Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

– Priska Aprilia
Sep 30 '15 at 7:56





Nope. I have edited my question. I typed "30 Sept 2015 4:43:42"

– Priska Aprilia
Sep 30 '15 at 7:56










4 Answers
4






active

oldest

votes


















61














You can set the system date with this command:



sudo date --set="2015-09-30 10:05:59.990"


Then when using date, it should be showed correctly.



Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:



sudo hwclock --systohc


This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.





To set your timezone, you can use this command:



sudo dpkg-reconfigure tzdata




BTW: If you use a this machine as a server, I strongly recommend using an NTP-Client to sync the time over network. So you can guarantee that all your servers have the exactly same time set. This will sync the time while the machine runs. If you have applications which are dependent of synced time over server, I recommend the NTP-Daemon. The longer it runs in the background, the more precise is the time.






share|improve this answer





















  • 1





    I missed the clock synchronization step. Thank you for your answer, it helped me!

    – Priska Aprilia
    Sep 30 '15 at 8:19






  • 1





    3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

    – Vladimir Ch
    Feb 25 '17 at 17:08











  • @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

    – PeterM
    Mar 25 '17 at 12:46



















3














I dislike setting system time manually. So to fix this issue I had to combine two different answers.

To fix system time you have to use this code:



sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"


as given in this answer

Then you sync the hardware clock with system clock using



sudo hwclock --systohc


as given by @chaos in this thread.






share|improve this answer

































    1














    just type in



    sudo date newdatestring


    with newdatestring in the format nnddhhmmyyyy.ss




    • nn: the (two digit) month (01 to 12)

    • dd: the (two digit) day (01 to 31), with the regular rules for days according to month and year applying

    • hh: the (two digit) hour (00 to 23)

    • mm: the (two digit) minute (00 to 59)

    • yyyy: the year; it can be two digit or four digit

    • ss is two digit seconds (00 to 59). Notice the period ‘.’ before the ss.


    But beside the date command, maybe you prefer the NTP "solution" (network time protocol): Serverguide - NTP, much easier to handle and more precise than setting the date by hand. You can use a cronjob or the ntp daemon (ntpd) to update you time every x hours/minutes...



    Hope this helps!






    share|improve this answer


























    • invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

      – Priska Aprilia
      Sep 30 '15 at 8:14











    • sudo date "093005082015.15" working on mine.

      – vusan
      Dec 29 '17 at 6:16



















    0















    1. Search for your timezone


    timedatectl list-timezones



    1. Set your timezone


    sudo timedatectl set-timezone America/Toronto



    1. Enable timesyncd


    sudo timedatectl set-ntp on


    With this, time should be set and synchronized.



    You can see more on this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04






    share|improve this answer
























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f679988%2fhow-to-change-ubuntus-server-date-and-time-via-command-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      61














      You can set the system date with this command:



      sudo date --set="2015-09-30 10:05:59.990"


      Then when using date, it should be showed correctly.



      Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:



      sudo hwclock --systohc


      This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.





      To set your timezone, you can use this command:



      sudo dpkg-reconfigure tzdata




      BTW: If you use a this machine as a server, I strongly recommend using an NTP-Client to sync the time over network. So you can guarantee that all your servers have the exactly same time set. This will sync the time while the machine runs. If you have applications which are dependent of synced time over server, I recommend the NTP-Daemon. The longer it runs in the background, the more precise is the time.






      share|improve this answer





















      • 1





        I missed the clock synchronization step. Thank you for your answer, it helped me!

        – Priska Aprilia
        Sep 30 '15 at 8:19






      • 1





        3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

        – Vladimir Ch
        Feb 25 '17 at 17:08











      • @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

        – PeterM
        Mar 25 '17 at 12:46
















      61














      You can set the system date with this command:



      sudo date --set="2015-09-30 10:05:59.990"


      Then when using date, it should be showed correctly.



      Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:



      sudo hwclock --systohc


      This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.





      To set your timezone, you can use this command:



      sudo dpkg-reconfigure tzdata




      BTW: If you use a this machine as a server, I strongly recommend using an NTP-Client to sync the time over network. So you can guarantee that all your servers have the exactly same time set. This will sync the time while the machine runs. If you have applications which are dependent of synced time over server, I recommend the NTP-Daemon. The longer it runs in the background, the more precise is the time.






      share|improve this answer





















      • 1





        I missed the clock synchronization step. Thank you for your answer, it helped me!

        – Priska Aprilia
        Sep 30 '15 at 8:19






      • 1





        3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

        – Vladimir Ch
        Feb 25 '17 at 17:08











      • @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

        – PeterM
        Mar 25 '17 at 12:46














      61












      61








      61







      You can set the system date with this command:



      sudo date --set="2015-09-30 10:05:59.990"


      Then when using date, it should be showed correctly.



      Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:



      sudo hwclock --systohc


      This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.





      To set your timezone, you can use this command:



      sudo dpkg-reconfigure tzdata




      BTW: If you use a this machine as a server, I strongly recommend using an NTP-Client to sync the time over network. So you can guarantee that all your servers have the exactly same time set. This will sync the time while the machine runs. If you have applications which are dependent of synced time over server, I recommend the NTP-Daemon. The longer it runs in the background, the more precise is the time.






      share|improve this answer















      You can set the system date with this command:



      sudo date --set="2015-09-30 10:05:59.990"


      Then when using date, it should be showed correctly.



      Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:



      sudo hwclock --systohc


      This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.





      To set your timezone, you can use this command:



      sudo dpkg-reconfigure tzdata




      BTW: If you use a this machine as a server, I strongly recommend using an NTP-Client to sync the time over network. So you can guarantee that all your servers have the exactly same time set. This will sync the time while the machine runs. If you have applications which are dependent of synced time over server, I recommend the NTP-Daemon. The longer it runs in the background, the more precise is the time.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Sep 30 '15 at 8:22









      Arronical

      13.7k84993




      13.7k84993










      answered Sep 30 '15 at 8:11









      chaoschaos

      19.8k85968




      19.8k85968








      • 1





        I missed the clock synchronization step. Thank you for your answer, it helped me!

        – Priska Aprilia
        Sep 30 '15 at 8:19






      • 1





        3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

        – Vladimir Ch
        Feb 25 '17 at 17:08











      • @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

        – PeterM
        Mar 25 '17 at 12:46














      • 1





        I missed the clock synchronization step. Thank you for your answer, it helped me!

        – Priska Aprilia
        Sep 30 '15 at 8:19






      • 1





        3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

        – Vladimir Ch
        Feb 25 '17 at 17:08











      • @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

        – PeterM
        Mar 25 '17 at 12:46








      1




      1





      I missed the clock synchronization step. Thank you for your answer, it helped me!

      – Priska Aprilia
      Sep 30 '15 at 8:19





      I missed the clock synchronization step. Thank you for your answer, it helped me!

      – Priska Aprilia
      Sep 30 '15 at 8:19




      1




      1





      3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

      – Vladimir Ch
      Feb 25 '17 at 17:08





      3 option helps, it changed etc/timezone =) like php.net/manual/en/timezones.php !!! absolutely identical !!!

      – Vladimir Ch
      Feb 25 '17 at 17:08













      @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

      – PeterM
      Mar 25 '17 at 12:46





      @VladimirCh Fortunatelly time zones names are stadarized, so we don't have to make any adjustments between systems. Oh, wait... there are some Microsoft version too...

      – PeterM
      Mar 25 '17 at 12:46













      3














      I dislike setting system time manually. So to fix this issue I had to combine two different answers.

      To fix system time you have to use this code:



      sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"


      as given in this answer

      Then you sync the hardware clock with system clock using



      sudo hwclock --systohc


      as given by @chaos in this thread.






      share|improve this answer






























        3














        I dislike setting system time manually. So to fix this issue I had to combine two different answers.

        To fix system time you have to use this code:



        sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"


        as given in this answer

        Then you sync the hardware clock with system clock using



        sudo hwclock --systohc


        as given by @chaos in this thread.






        share|improve this answer




























          3












          3








          3







          I dislike setting system time manually. So to fix this issue I had to combine two different answers.

          To fix system time you have to use this code:



          sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"


          as given in this answer

          Then you sync the hardware clock with system clock using



          sudo hwclock --systohc


          as given by @chaos in this thread.






          share|improve this answer















          I dislike setting system time manually. So to fix this issue I had to combine two different answers.

          To fix system time you have to use this code:



          sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"


          as given in this answer

          Then you sync the hardware clock with system clock using



          sudo hwclock --systohc


          as given by @chaos in this thread.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 18 '18 at 6:42









          muru

          1




          1










          answered Jan 18 '18 at 6:26









          twitutwitu

          412




          412























              1














              just type in



              sudo date newdatestring


              with newdatestring in the format nnddhhmmyyyy.ss




              • nn: the (two digit) month (01 to 12)

              • dd: the (two digit) day (01 to 31), with the regular rules for days according to month and year applying

              • hh: the (two digit) hour (00 to 23)

              • mm: the (two digit) minute (00 to 59)

              • yyyy: the year; it can be two digit or four digit

              • ss is two digit seconds (00 to 59). Notice the period ‘.’ before the ss.


              But beside the date command, maybe you prefer the NTP "solution" (network time protocol): Serverguide - NTP, much easier to handle and more precise than setting the date by hand. You can use a cronjob or the ntp daemon (ntpd) to update you time every x hours/minutes...



              Hope this helps!






              share|improve this answer


























              • invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

                – Priska Aprilia
                Sep 30 '15 at 8:14











              • sudo date "093005082015.15" working on mine.

                – vusan
                Dec 29 '17 at 6:16
















              1














              just type in



              sudo date newdatestring


              with newdatestring in the format nnddhhmmyyyy.ss




              • nn: the (two digit) month (01 to 12)

              • dd: the (two digit) day (01 to 31), with the regular rules for days according to month and year applying

              • hh: the (two digit) hour (00 to 23)

              • mm: the (two digit) minute (00 to 59)

              • yyyy: the year; it can be two digit or four digit

              • ss is two digit seconds (00 to 59). Notice the period ‘.’ before the ss.


              But beside the date command, maybe you prefer the NTP "solution" (network time protocol): Serverguide - NTP, much easier to handle and more precise than setting the date by hand. You can use a cronjob or the ntp daemon (ntpd) to update you time every x hours/minutes...



              Hope this helps!






              share|improve this answer


























              • invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

                – Priska Aprilia
                Sep 30 '15 at 8:14











              • sudo date "093005082015.15" working on mine.

                – vusan
                Dec 29 '17 at 6:16














              1












              1








              1







              just type in



              sudo date newdatestring


              with newdatestring in the format nnddhhmmyyyy.ss




              • nn: the (two digit) month (01 to 12)

              • dd: the (two digit) day (01 to 31), with the regular rules for days according to month and year applying

              • hh: the (two digit) hour (00 to 23)

              • mm: the (two digit) minute (00 to 59)

              • yyyy: the year; it can be two digit or four digit

              • ss is two digit seconds (00 to 59). Notice the period ‘.’ before the ss.


              But beside the date command, maybe you prefer the NTP "solution" (network time protocol): Serverguide - NTP, much easier to handle and more precise than setting the date by hand. You can use a cronjob or the ntp daemon (ntpd) to update you time every x hours/minutes...



              Hope this helps!






              share|improve this answer















              just type in



              sudo date newdatestring


              with newdatestring in the format nnddhhmmyyyy.ss




              • nn: the (two digit) month (01 to 12)

              • dd: the (two digit) day (01 to 31), with the regular rules for days according to month and year applying

              • hh: the (two digit) hour (00 to 23)

              • mm: the (two digit) minute (00 to 59)

              • yyyy: the year; it can be two digit or four digit

              • ss is two digit seconds (00 to 59). Notice the period ‘.’ before the ss.


              But beside the date command, maybe you prefer the NTP "solution" (network time protocol): Serverguide - NTP, much easier to handle and more precise than setting the date by hand. You can use a cronjob or the ntp daemon (ntpd) to update you time every x hours/minutes...



              Hope this helps!







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Sep 30 '15 at 8:09

























              answered Sep 30 '15 at 8:00









              WolfgangWolfgang

              678411




              678411













              • invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

                – Priska Aprilia
                Sep 30 '15 at 8:14











              • sudo date "093005082015.15" working on mine.

                – vusan
                Dec 29 '17 at 6:16



















              • invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

                – Priska Aprilia
                Sep 30 '15 at 8:14











              • sudo date "093005082015.15" working on mine.

                – vusan
                Dec 29 '17 at 6:16

















              invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

              – Priska Aprilia
              Sep 30 '15 at 8:14





              invalid date range when i tried with "093005082015.15" which stands for 30 Sept 2015, 05:08:15

              – Priska Aprilia
              Sep 30 '15 at 8:14













              sudo date "093005082015.15" working on mine.

              – vusan
              Dec 29 '17 at 6:16





              sudo date "093005082015.15" working on mine.

              – vusan
              Dec 29 '17 at 6:16











              0















              1. Search for your timezone


              timedatectl list-timezones



              1. Set your timezone


              sudo timedatectl set-timezone America/Toronto



              1. Enable timesyncd


              sudo timedatectl set-ntp on


              With this, time should be set and synchronized.



              You can see more on this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04






              share|improve this answer




























                0















                1. Search for your timezone


                timedatectl list-timezones



                1. Set your timezone


                sudo timedatectl set-timezone America/Toronto



                1. Enable timesyncd


                sudo timedatectl set-ntp on


                With this, time should be set and synchronized.



                You can see more on this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04






                share|improve this answer


























                  0












                  0








                  0








                  1. Search for your timezone


                  timedatectl list-timezones



                  1. Set your timezone


                  sudo timedatectl set-timezone America/Toronto



                  1. Enable timesyncd


                  sudo timedatectl set-ntp on


                  With this, time should be set and synchronized.



                  You can see more on this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04






                  share|improve this answer














                  1. Search for your timezone


                  timedatectl list-timezones



                  1. Set your timezone


                  sudo timedatectl set-timezone America/Toronto



                  1. Enable timesyncd


                  sudo timedatectl set-ntp on


                  With this, time should be set and synchronized.



                  You can see more on this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 16 mins ago









                  NatoBoramNatoBoram

                  19812




                  19812






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f679988%2fhow-to-change-ubuntus-server-date-and-time-via-command-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      List of shipwrecks in 1808...

                      Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

                      Unit packagekit.service is masked Announcing the arrival of Valued Associate #679: Cesar...