Java Date String Format formate8Date(String str)

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

Description

formate Date

License

Open Source License

Parameter

Parameter Description
str a parameter

Declaration

public static String formate8Date(String str) 

Method Source Code

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

public class Main {
    /**/*  w ww . j  a  v  a  2  s  . c o m*/
     * 
     * @param str
     * @return
     */
    public static String formate8Date(String str) {
        if (str.length() == 8) {
            return str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6, 8);
        }
        return str;
    }
}

Related

  1. formatDateLog(String dateStr)
  2. formatDateString(String dateString)
  3. FormatDateString(String dateString)
  4. formatDateToParse(String date, String errorMessage)
  5. formatDay(String date)
  6. formatIso8601ToSimpleDate(String iso8601)
  7. formatISODate(String date)
  8. formatMinDateForShowWith_(String str)
  9. formatQuery(String queryDate)