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
精彩评论