The premise is that the phone must first obtain root; The root method is described in other chapters or on the web.
ADB shell enters Shell terminal interface
1. Set the time zone configuration of the system first
cat /data/property/persist.sys.timezone //View current time zone profile
setprop persist.sys.timezone gmt //Modify the attribute
2, start setting Modify current system time
Date-s "YYYYMMDD. [[[Hh]mm]ss] "or system/bin/date-s " yyyymmdd.[ [[Hh]mm]ss] "
3. See if it takes effect
Date
Second, the implementation of the code to modify the Android system time method
public void TestDate () {
try {
process process = Runtime.getruntime (). EXEC ("su");
String datetime= "20131023.112800";//Test Set time "time format Yyyymmdd.hhmmss"
Span style= "White-space:pre" > dataoutputstream os = new DataOutputStream (Process.getoutputstream ());
os.writebytes ("SetProp persist.sys.timezone gmt\n");
os.writebytes ("/system/bin/date-s" +datetime+ "\ n");
os.writebytes ("clock-w\n");
os.writebytes ("exit\n");
Os.flush ();
} catch (IOException e) {
E.printstacktrace ();
}
}