Java Hour Format format(Date date)

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

Description

format

License

Open Source License

Declaration

public static String format(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 format(Date date) {
        return formatDate(date, _DEFAULT4);
    }/*w ww  .j a v a2  s .  c  om*/

    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. format(Date date)
  2. format(Date date)
  3. format(Date date)
  4. format(Date date)
  5. format(Date date)
  6. format(Date date)
  7. format(Date date)
  8. format(Date date)
  9. format(Date date)