Java Year Format formateDate2yyyyMMdd()

Here you can find the source of formateDate2yyyyMMdd()

Description

formate Dateyyyy M Mdd

License

Open Source License

Declaration

public static String formateDate2yyyyMMdd() 

Method Source Code


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

public class Main {
    /**//from   w ww.  j  a  v a2 s  .c o  m
     * pattern "yyyyMMdd""20160322"  
     */
    private static final String YYYYMMDD = "yyyyMMdd";

    public static String formateDate2yyyyMMdd() {
        return formateCurrentDate2String(YYYYMMDD);
    }

    private static String formateCurrentDate2String(String pattern) {
        Date date = new Date();
        return new SimpleDateFormat(pattern).format(date);
    }
}

Related

  1. format(final int iDay, final int iMonth, final int iYear)
  2. format(String day, String month, String year, Locale locale)
  3. format2yyyyMMdd(Date date)
  4. format_D_MM_YYYY_HH_MM(Date date)
  5. formatInyyyyMMdd(java.util.Date date)
  6. formatMdDdYySlashed(Date date)
  7. formatMmDdYyyy(final Date date)
  8. formatMonth(int timeInfo, String yearInfo)