如何在android datepicker中显示月份的前三个字母 [英] How to display First three letters of the month in android datepicker

查看:12
本文介绍了如何在android datepicker中显示月份的前三个字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在日期选择器中,我试图用字母表示月份,其他数字是整数它正在返回月份的全名.但我想要这个月的前三个字母.

In date Picker I tried to get month in letter others are in integer It's returning full name of the month. But i want first threes letters of the month.

我试过:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy,MMMM, dd ");
System.out.println(sdf.format(new SimpleDateFormat(new Date()).toString()));

输出:2013 年 10 月 18 日

output: 2013-October-18

我希望输出为:2013 年 10 月 18 日

I want output as : 2013-Oct-18

推荐答案

使用MMM,像这样SimpleDateFormat("yyyy-MMM-dd ")

这篇关于如何在android datepicker中显示月份的前三个字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆