Java yyyy formatDate(String date)

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

Description

format Date

License

Apache License

Declaration

public static Date formatDate(String date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.*;
import java.util.*;

public class Main {
    public static final DateFormat DEFAUALT_DATE_FORMAT = new SimpleDateFormat(
            "dd/MM/yyyy");

    public static Date formatDate(String date) {
        try {//from w w  w .  j  av  a  2  s  . com
            return DEFAUALT_DATE_FORMAT.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. formatDate(Date date, TimeZone timeZone)
  2. formatDate(Date inputDate, String formatPattern)
  3. formatDate(Date unformattedDate, String format)
  4. formatDate(DateTime aDateTime)
  5. formatDate(final Date date, final String defaultValue)
  6. formatDate(String date)
  7. formatDate(String date)
  8. formatDate(String inputDate)
  9. formatDate2DateStr()