相关疑难解决方法(0)

如何在Android中获取用户选择的日期格式?

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

DateFormat df = android.text.format.DateFormat.getDateFormat(context.getApplicationContext());
tv.setText(df.format(date));
Run Code Online (Sandbox Code Playgroud)

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

format datetime android locale

14
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

datetime ×1

format ×1

locale ×1