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 synchronized String format(Date date) 

Method Source Code


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

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    private static final DateFormat dateFormat = new SimpleDateFormat("dd/MM/yy - HH:mm:ss");

    public static synchronized String format(Date date) {
        if (date == null) {
            return null;
        }/* w w  w . j a v  a 2 s. co  m*/
        return dateFormat.format(date);
    }

    public static synchronized String format(Calendar calendar) {
        if (calendar == null) {
            return null;
        }
        return dateFormat.format(calendar.getTime());
    }
}

Related

  1. format(Calendar date)
  2. format(Date d)
  3. format(Date d)
  4. format(Date d)
  5. format(Date date)
  6. format(Date date)
  7. format(Date date)
  8. format(Date date)
  9. format(Date date)