开发者

Dateformat in android

开发者 https://www.devze.com 2023-02-12 16:28 出处:网络
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

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

精彩评论

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