Java Date String Format formatMinDateForShowWith_(String str)

Here you can find the source of formatMinDateForShowWith_(String str)

Description

format Min Date For Show Wit_

License

Open Source License

Declaration

public static String formatMinDateForShowWith_(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String formatMinDateForShowWith_(String str) {
        String res = "";
        try {/*from   ww w. j a  v a2  s . c o  m*/
            if (str.length() >= 4) {
                res += str.substring(0, 4);
            }
            if (str.length() >= 6) {
                res += "-" + Integer.parseInt(str.substring(4, 6));
            }
            if (str.length() >= 8) {
                res += "-" + Integer.parseInt(str.substring(6, 8));
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {

        }
        return res;
    }
}

Related

  1. formatDateToParse(String date, String errorMessage)
  2. formatDay(String date)
  3. formate8Date(String str)
  4. formatIso8601ToSimpleDate(String iso8601)
  5. formatISODate(String date)
  6. formatQuery(String queryDate)
  7. formatShort(String strDate)
  8. formatShow(String queryDate)
  9. formatTweetDate1(String date)