Java Date Format As formatDay(Date date)

Here you can find the source of formatDay(Date date)

Description

format Day

License

Open Source License

Declaration

public static String formatDay(Date date) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static final String _DEFAULT1 = "yyyy-MM-dd HH:mm";
    public static final String _DEFAULT4 = "yyyy-MM-dd";

    public static String formatDay(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date);
    }// www.j  av  a  2  s .c  o m

    public static String format(Date date) {
        return formatDate(date, _DEFAULT4);
    }

    public static String formatDate(Date date) {
        return formatDate(date, _DEFAULT1);
    }

    public static String formatDate(Date date, String style) {
        return new SimpleDateFormat(style).format(date);
    }
}

Related

  1. formatDateW3C(Date date)
  2. formatDateWithMilliseconds(DateFormat aFormat, Date aDate)
  3. formatDateYMD(Object date)
  4. formatDateYyyymmddhhmmss(Date date)
  5. formatDatum(Date date, Locale locale)
  6. formatDay(java.util.Date d)
  7. formatDDMMYYYY(Date date)
  8. formatddMMyyyy(Date date)
  9. getDateAsISO8601String(Date date)