Java Hour Format formatTime(Date time)

Here you can find the source of formatTime(Date time)

Description

format Time

License

Open Source License

Declaration

public static String formatTime(Date time) throws Exception 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String formatTime(long time) throws Exception {
        return DATE_FORMAT.format(new Date(time));
    }//ww  w  .ja v  a  2  s  . c o m

    public static String formatTime(Date time) throws Exception {
        return DATE_FORMAT.format(time);
    }
}

Related

  1. formatTime(Date date)
  2. formatTime(Date date)
  3. formatTime(Date date)
  4. formatTime(Date date)
  5. formatTime(Date date)
  6. formatTime(Date time)
  7. formatTime(double s)
  8. formatTime(final Calendar cal)
  9. formatTime(final Date date)