Changing Date using date command along with time zone

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












How to change the date using date command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )







share|improve this question






















  • Please mention distro and version in body to get precise answer specific to your issue.
    – Nikhil_CV
    Mar 15 at 7:47














up vote
0
down vote

favorite












How to change the date using date command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )







share|improve this question






















  • Please mention distro and version in body to get precise answer specific to your issue.
    – Nikhil_CV
    Mar 15 at 7:47












up vote
0
down vote

favorite









up vote
0
down vote

favorite











How to change the date using date command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )







share|improve this question














How to change the date using date command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )









share|improve this question













share|improve this question




share|improve this question








edited Mar 15 at 8:51

























asked Mar 15 at 7:35









Ashwin Geet D'Sa

32




32











  • Please mention distro and version in body to get precise answer specific to your issue.
    – Nikhil_CV
    Mar 15 at 7:47
















  • Please mention distro and version in body to get precise answer specific to your issue.
    – Nikhil_CV
    Mar 15 at 7:47















Please mention distro and version in body to get precise answer specific to your issue.
– Nikhil_CV
Mar 15 at 7:47




Please mention distro and version in body to get precise answer specific to your issue.
– Nikhil_CV
Mar 15 at 7:47










2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ environment variable to a value such as Asia/Calcutta (on a user-by-user basis), or by setting the system's timezone. The date command is not used for setting the timezone.



Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata. On OpenBSD it is done by creating a symbolic link from /etc/localtime to the correct timezone file under /usr/share/zoneinfo (e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta).






share|improve this answer



























    up vote
    0
    down vote













    When setting the date with date, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.



    In short: date is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430334%2fchanging-date-using-date-command-along-with-time-zone%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote



      accepted










      In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ environment variable to a value such as Asia/Calcutta (on a user-by-user basis), or by setting the system's timezone. The date command is not used for setting the timezone.



      Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata. On OpenBSD it is done by creating a symbolic link from /etc/localtime to the correct timezone file under /usr/share/zoneinfo (e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta).






      share|improve this answer
























        up vote
        0
        down vote



        accepted










        In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ environment variable to a value such as Asia/Calcutta (on a user-by-user basis), or by setting the system's timezone. The date command is not used for setting the timezone.



        Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata. On OpenBSD it is done by creating a symbolic link from /etc/localtime to the correct timezone file under /usr/share/zoneinfo (e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta).






        share|improve this answer






















          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ environment variable to a value such as Asia/Calcutta (on a user-by-user basis), or by setting the system's timezone. The date command is not used for setting the timezone.



          Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata. On OpenBSD it is done by creating a symbolic link from /etc/localtime to the correct timezone file under /usr/share/zoneinfo (e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta).






          share|improve this answer












          In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ environment variable to a value such as Asia/Calcutta (on a user-by-user basis), or by setting the system's timezone. The date command is not used for setting the timezone.



          Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata. On OpenBSD it is done by creating a symbolic link from /etc/localtime to the correct timezone file under /usr/share/zoneinfo (e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 15 at 7:44









          Kusalananda

          103k13201318




          103k13201318






















              up vote
              0
              down vote













              When setting the date with date, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.



              In short: date is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?






              share|improve this answer
























                up vote
                0
                down vote













                When setting the date with date, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.



                In short: date is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  When setting the date with date, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.



                  In short: date is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?






                  share|improve this answer












                  When setting the date with date, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.



                  In short: date is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 15 at 7:45









                  Olorin

                  1,15711




                  1,15711






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430334%2fchanging-date-using-date-command-along-with-time-zone%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay