Java yyyy format(Date date)

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

Description

format

License

Apache License

Declaration

public static String format(Date date) 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String format(Date date, String pattern) {
        if (date == null)
            return "";
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.format(date);
    }/*w ww . j a v a 2s. co m*/

    public static String format(Date date) {
        return format(date, "yyyy-MM-dd");
    }
}

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, String format)
  8. format(Date date, String pattern)
  9. format(Date date, String pattern)