开发者

Dateformat in android

I want to get the date format like this feb 17,2011 18:13 开发者_如何学Pythonin android...

Thanks.


The class SimpleDateFormat provides the necessary tools to do this: http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html


Use SimpleDateFormat.

    SimpleDateFormat sf = new SimpleDateFormat("MMM dd','yyyy HH:mm");
    Date someDate = new Date();
    String date = sf.format(someDate);


Use getDateTimeInstance method of DateFormat class

Reference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜