Java Date String Format formatDate(Integer date)

Here you can find the source of formatDate(Integer date)

Description

format Date

License

Open Source License

Declaration

public static String formatDate(Integer date) 

Method Source Code

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

public class Main {

    public static String formatDate(Integer date) {
        try {//w  w  w.  j av  a2  s .co  m
            return (date + "").substring(0, 4) + "-" + (date + "").substring(4, 6) + "-"
                    + (date + "").substring(6, 8);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return "";
        }
    }
}

Related

  1. dateFormat(String datetime)
  2. dateFormat(String strYear, String strMonth, String strDay)
  3. dateFormatFix(String str)
  4. formatDate(byte[] btValue, int iOffset, int iLength)
  5. formatDate(int year, int month, int day)
  6. formatDate(Integer day, Integer month, Integer year)
  7. FormatDate(String aDate)
  8. formatDate(String date)
  9. formatDate(String date)