Android default time format modification method

Source: Internet
Author: User

When using android, you are always helpless when you modify the default time format. This article will provide a solution to this problem. For more information, see

When the language is English, the default time format is mm/DD/yyyy. How can I change the default time format to DD/mm/yyyy, I don't know whether the initial value is given at the framework layer initialization or during compilation. Which of the following heroes knows how to do this?

1. Modify the file
Alps \ frameworks \ base \ packages \ SettingsProvider \ res \ values \ defaults. xml
Add code <string name = "time_12_24" translatable = "false"> 24 </string>
The red flag indicates the 24-hour format. It can also be changed to 12 (12-hour format)

2. Modify the file alps \ frameworks \ base \ packages \ SettingsProvider \ src \ com \ android \ providers \ settings \ DatabaseHelper. java
Find the loadSystemSettings () function and add the following statement to the function:
LoadStringSetting (stmt, Settings. System. TIME_12_24, R. string. time_12_24 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.