Android DatePicker显示月份名称 [英] Android DatePicker display Month name
本文介绍了Android DatePicker显示月份名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用日期选择器,并选择我要以以下格式显示日期
I am trying use Date Picker and on Select i want to display the date in the following format
[月名] [日期],[年]
[Month name] [date], [year]
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR)-13;
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
,以月为单位。如何获取月份名称而不是数字。
that gives Month as a number. How to get the name of the month instead of number.
推荐答案
public static final String[] MONTHS = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
使用数组并通过 MONTHS [monthNumber] $获得字符串c $ c>。
这篇关于Android DatePicker显示月份名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文