Java Year Format toDateString(String ddMMMyyyy)

Here you can find the source of toDateString(String ddMMMyyyy)

Description

to Date String

License

Open Source License

Declaration

public static String toDateString(String ddMMMyyyy) 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    public static String toDateString(String ddMMMyyyy) {

        String dateString = "";
        try {/*from   w ww  .  j  a v  a 2  s  .  co  m*/
            Date date = new SimpleDateFormat("ddMMMyyyy", Locale.US).parse(ddMMMyyyy);
            dateString = new SimpleDateFormat("yyyy-MM-dd", Locale.US).format(date);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }

        return dateString;
    }
}

Related

  1. isYear(String str, boolean nullCheck)
  2. isYearOnly(String input)
  3. isYYYY(String strDate)
  4. lastDayOfWeek(String year, int week, String format)
  5. stringYYYYmmDDhhMMssToDate(String value)
  6. toYYYYMM(Date date)
  7. toYYYYMMDD(Calendar cal)
  8. toYyyyMMddToDate(String date)
  9. unmarshalYYYYMMDD(String date)