String date = '15/2/2014'
SimpleDateFormat simpleDate = new SimpleDateFormat("dd/MM/yyyy");
Date d = simpleDate.parse(date);
now Date d return : d= Sat Feb 15 00:00:00 MMT 2014
.
I want to get this format d= '15/2/2014'
How can I do it?
String date = '15/2/2014'
SimpleDateFormat simpleDate = new SimpleDateFormat("dd/MM/yyyy");
Date d = simpleDate.parse(date);
now Date d return : d= Sat Feb 15 00:00:00 MMT 2014
.
I want to get this format d= '15/2/2014'
How can I do it?
Try the code below
Note
for more detail check http://developer.android.com/reference/java/util/Calendar.html#JANUARY
You can try like this: (Here you can change
time variable
with your input string)Wouldn't you use just format before the ("dd/mm/yyyy")?
Try this:
Hope this help.