how do i change timezone using adb

前端 未结 6 692
我寻月下人不归
我寻月下人不归 2020-12-05 19:30

I want to change the timezone using adb shell command.

I went through some posts which allow changing it in linux, but they are not valid for android.

6条回答
  •  Happy的楠姐
    2020-12-05 19:57

    I changed 2 files to change my timezone.

    the one that i don't entire know if it's necessary, but it keeps things in sync:

      /etc/timezone
    

    the more one you for sure need to change:

      /etc/localtime
    

    from http://www.cyberciti.biz/faq/linux-unix-set-tz-environment-variable/ you can determine the name of the timezone you want with tzselect.

    I took inspiration from http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/ and copied my timezone file from /usr/share/zoneinfo/ to /etc/localtime.

    /etc/timezone is a text file with the name of the timezone. so i just updated it to match the value provided by tzselect.

提交回复
热议问题