Java Date String Format FormatDate6(String strDate)

Here you can find the source of FormatDate6(String strDate)

Description

Format Date

License

Open Source License

Declaration


public static String FormatDate6(String strDate)

    

Method Source Code

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

public class Main {

    public static String FormatDate6(String strDate)

    {//from  w  w w . ja v  a  2 s  .  c o  m

        if (strDate == null) {
            return "";
        }

        strDate = strDate.trim();

        if (strDate.length() < 6) {
            return "";
        }

        else {
            return "20" + strDate.substring(0, 2) + "-" + strDate.substring(2, 4) + "-" + strDate.substring(4);
        }

    }
}

Related

  1. formatDate(String dateString, String delimiter)
  2. formatDate(String fieldName)
  3. FormatDate(String strDate, char DateSeparator)
  4. formatDate(String unformattedDate, String format)
  5. formatDate(String values)
  6. formatDateLog(String dateStr)
  7. formatDateString(String dateString)
  8. FormatDateString(String dateString)
  9. formatDateToParse(String date, String errorMessage)