Here you can find the source of convertDateStringToDash(String MonthDayYear)
@SuppressLint("SimpleDateFormat") public static String convertDateStringToDash(String MonthDayYear)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; public class Main { @SuppressLint("SimpleDateFormat") public static String convertDateStringToDash(String MonthDayYear) { String convertedDate = ""; SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); Date date;//w w w . ja v a 2 s . co m try { date = formatter.parse(MonthDayYear); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); convertedDate = df.format(date); } catch (Exception e) { } return convertedDate; } }