adb shell date帮助
adb shell date --help
usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]
Set/get the current date/time. With no SET shows the current date.
-d Show DATE instead of current time (convert date format)
-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])
-r Use modification time of FILE instead of current date
-u Use UTC instead of current timezone
Supported input formats:
MMDDhhmm[[CC]YY][.ss] POSIX
@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01
YYYY-MM-DD [hh:mm[:ss]] ISO 8601
hh:mm[:ss] 24-hour time today
All input formats can be preceded by TZ="id" to set the input time zone
separately from the output time zone. Otherwise $TZ sets both.
+FORMAT specifies display format string using strftime(3) syntax:
%% literal % %n newline %t tab
%S seconds (00-60) %M minute (00-59) %m month (01-12)
%H hour (0-23) %I hour (01-12) %p AM/PM
%y short year (00-99) %Y year %C century
%a short weekday name %A weekday name %u day of week (1-7, 1=mon)
%b short month name %B month name %Z timezone name
%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)
%N nanosec (output only)
%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)
%V Week of year (1-53 start monday, week < 4 days not part of this year)
%F "%Y-%m-%d" %R "%H:%M" %T "%H:%M:%S" %z numeric timezone
%D "%m/%d/%y" %r "%I:%M:%S %p" %h "%b" %s unix epoch time
%x locale date %X locale time %c locale date/time
1、设置时间
adb root
adb remount
adb shell date "2023-01-11 18:00:00"
adb shell "date 01111800.00"
# 1月11号 下午6点/18点 :日落
adb root
adb remount
adb shell date "2023-01-11 07:00:00"
adb shell "date 01110700.00"
# 1月11号 上午7点 : 日出
adb root
adb remount
adb shell date "2023-01-11 08:00:00"
adb shell "date 01110800.00"
# 1月11号 上午8点
2、读取时间
adb shell "date"
Tue Jan 11 00:01:53 CST 2022
3、设置时区
adb shell "setprop persist.sys.timezone Pacific/Midway"
Pacific/Midway为设置的时区文章来源地址https://www.toymoban.com/news/detail-503246.html
4、读取时区
adb shell "getprop persist.sys.timezone"
Asia/Shanghai
文章来源:https://www.toymoban.com/news/detail-503246.html
到了这里,关于adb shell date 修改系统时间和时区的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!