差别
这里会显示出您选择的修订版和当前版本之间的差别。
tips:changing_the_timezone [2022/04/16 09:19] baolitoumu 创建 |
— (当前版本) | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Changing the Timezone ====== | ||
- | |||
- | Changing the timezone may be required for the development of custom applications, | ||
- | |||
- | ===== Temporarily Changing The Timezone ===== | ||
- | |||
- | To temporarily change the timezone for the current shell instance, you can set the TZ variable to the appropriate timezone | ||
- | |||
- | < | ||
- | $ TZ=" | ||
- | $ date | ||
- | Fri dec 8 10:38:50 CET 2017 | ||
- | </ | ||
- | |||
- | **Note: The timezone change is restricted to the shell session in which it has been set. Attempting to retrieve the time outside of the current shell session will display the old timezone** | ||
- | |||
- | ===== Permanently Changing The Timezone ===== | ||
- | ==== timedatectl ==== | ||
- | |||
- | Permanently changing your timezone is as simple as running the following: | ||
- | |||
- | < | ||
- | timedatectl set-timezone < | ||
- | </ | ||
- | |||
- | To see what timezones are available look at the contents of ''/ | ||
- | |||
- | ==== reZone script ==== | ||
- | |||
- | The reZone script provided by the [[https:// | ||
- | |||
- | Download the script | ||
- | |||
- | < | ||
- | $ curl https:// | ||
- | </ | ||
- | |||
- | Finally execute the script. If you opt to connect to your device trough wireless instead of USB, you may provide the IP address as parameter | ||
- | |||
- | < | ||
- | $ chmod +x rezone.sh | ||
- | $ ./rezone.sh | ||
- | </ | ||
- | |||
- | If no issues were raised, the timezone has been changed and the script will confirm the success. | ||
- | |||
- | ==== Manually Updating the Timezone ==== | ||
- | |||
- | To update the timezone manually, the following line must be edited in ''/ | ||
- | |||
- | < | ||
- | TZ=" | ||
- | </ | ||
- | |||
- | To your new timezone (ie CET) | ||
- | < | ||
- | TZ=" | ||
- | </ | ||
- | |||
- | After the line has been changed, save your changes. To confirm your new timezone, instance a new shell and execute '' | ||
- | |||
- | < | ||
- | $ bash | ||
- | $ date | ||
- | Fri dec 8 11:23:46 CET 2017 | ||
- | </ | ||