Java Year Format getyyyy_MM_dd2(String date)

Here you can find the source of getyyyy_MM_dd2(String date)

Description

getyyyMdd

License

Open Source License

Declaration

public static String getyyyy_MM_dd2(String date) throws ParseException 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    public static String getyyyy_MM_dd2(String date) throws ParseException {
        if (date == null)
            return "";
        return sdf.format(sdf.parse(date));
    }//from   w w w .j  a v a2s. com
}

Related

  1. getYYMMDD()
  2. getYYMMDD(int i)
  3. getYYYY()
  4. getYYYY(java.util.Date date)
  5. getyyyy_MM_dd(Date date)
  6. getYYYYMM()
  7. getYYYYMM(final Date date, final String separator)
  8. getYYYYMMDD(Date date)
  9. getYYYYMMDD(Date date)