<tfoot id='RJszd'></tfoot>

<legend id='RJszd'><style id='RJszd'><dir id='RJszd'><q id='RJszd'></q></dir></style></legend>
    • <bdo id='RJszd'></bdo><ul id='RJszd'></ul>

    1. <small id='RJszd'></small><noframes id='RJszd'>

        <i id='RJszd'><tr id='RJszd'><dt id='RJszd'><q id='RJszd'><span id='RJszd'><b id='RJszd'><form id='RJszd'><ins id='RJszd'></ins><ul id='RJszd'></ul><sub id='RJszd'></sub></form><legend id='RJszd'></legend><bdo id='RJszd'><pre id='RJszd'><center id='RJszd'></center></pre></bdo></b><th id='RJszd'></th></span></q></dt></tr></i><div id='RJszd'><tfoot id='RJszd'></tfoot><dl id='RJszd'><fieldset id='RJszd'></fieldset></dl></div>
      1. 如何在 Android 中获取用户选择的日期格式?

        时间:2023-08-31

      2. <legend id='SDUps'><style id='SDUps'><dir id='SDUps'><q id='SDUps'></q></dir></style></legend>

          <small id='SDUps'></small><noframes id='SDUps'>

              <tbody id='SDUps'></tbody>

                <tfoot id='SDUps'></tfoot>

                <i id='SDUps'><tr id='SDUps'><dt id='SDUps'><q id='SDUps'><span id='SDUps'><b id='SDUps'><form id='SDUps'><ins id='SDUps'></ins><ul id='SDUps'></ul><sub id='SDUps'></sub></form><legend id='SDUps'></legend><bdo id='SDUps'><pre id='SDUps'><center id='SDUps'></center></pre></bdo></b><th id='SDUps'></th></span></q></dt></tr></i><div id='SDUps'><tfoot id='SDUps'></tfoot><dl id='SDUps'><fieldset id='SDUps'></fieldset></dl></div>
                  <bdo id='SDUps'></bdo><ul id='SDUps'></ul>

                  本文介绍了如何在 Android 中获取用户选择的日期格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直在研究 Android 手机中用户选择的日期格式问题.我在stackoverlow上经历了几乎很多问题和答案,但还没有得到完美的答案.例如:-我在电话中选择的日期格式是星期六,2011 年 12 月 31 日"但是当我使用作为在stackoverflow上回答的基础问题时:-

                  I have been working on problem of date format selected by users in the Android Phone. I have gone through almost many question and answers on the stackoverlow and havent got the perfect answer. For example:- I have selected dateformat in phone is "Sat, 31 Dec 2011" But when I used as based question answered on stackoverflow:-

                  DateFormat df = android.text.format.DateFormat.getDateFormat(context.getApplicationContext());
                  tv.setText(df.format(date));
                  

                  以上代码返回 06/08/2011 (mm/dd/yyyy) 格式.但是请查看我在手机上选择的日期格式.我怎样才能得到确切的格式?

                  Above code returns me 06/08/2011 (mm/dd/yyyy) format. But see the date format i selected on phone. How can i get the exact format?

                  推荐答案

                  在我目前正在开发的应用程序中,我使用以下内容,我相信它会满足您的要求

                  In an application I'm currently developing I use the following, which I believe will do what you require

                  final String format = Settings.System.getString(getContentResolver(), Settings.System.DATE_FORMAT);
                  if (TextUtils.isEmpty(format)) {
                    dateFormat = android.text.format.DateFormat.getMediumDateFormat(getApplicationContext());
                  } else {
                    dateFormat = new SimpleDateFormat(format);
                  }
                  

                  这篇关于如何在 Android 中获取用户选择的日期格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:MPAndroidChart x 轴日期/时间标签格式 下一篇:将 PDF 转换为图像(格式正确)

                  相关文章

                  最新文章

                  <legend id='U0VHR'><style id='U0VHR'><dir id='U0VHR'><q id='U0VHR'></q></dir></style></legend>
                  1. <i id='U0VHR'><tr id='U0VHR'><dt id='U0VHR'><q id='U0VHR'><span id='U0VHR'><b id='U0VHR'><form id='U0VHR'><ins id='U0VHR'></ins><ul id='U0VHR'></ul><sub id='U0VHR'></sub></form><legend id='U0VHR'></legend><bdo id='U0VHR'><pre id='U0VHR'><center id='U0VHR'></center></pre></bdo></b><th id='U0VHR'></th></span></q></dt></tr></i><div id='U0VHR'><tfoot id='U0VHR'></tfoot><dl id='U0VHR'><fieldset id='U0VHR'></fieldset></dl></div>
                    • <bdo id='U0VHR'></bdo><ul id='U0VHR'></ul>
                  2. <tfoot id='U0VHR'></tfoot>

                  3. <small id='U0VHR'></small><noframes id='U0VHR'>