1. Frameworks/base/packages/settingsprovider/res/values/defaults.xml
Add <stringname= "time_12_24" >12</string>//24-hour change to 24
2. Frameworks/base/packages/settingsprovider/src/com/android/providers/settings/databasehelper.java file,
In the Loadsystemsettings () method, add
Loadstringsetting (stmt,settings.system.time_12_24,r.string.time_12_24);
3. "Settings-" date and time-"use 24-hour format, modify default to open"
Frameworks\base\core\java\android\text\format\dateformat.java
Switch
public static Booleanis24hourformat (context context) {
String value = Settings.System.getString (Context.getcontentresolver (),
SETTINGS.SYSTEM.TIME_12_24);
if (value ==null) {
Settings.System.putString (Context.getcontentresolver (),
Settings.System.TIME_12_24, "24");
Value = "24";
}
Returnvalue.equals ("24");
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android System Modification time format is 24-hour