Java Hour Format formatTime(Date date)

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

Description

format Time

License

Open Source License

Declaration

public static String formatTime(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String formatTime(Date date) {
        String dateString = date.toString();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm");
        try {/* w w w.ja  v  a2  s.  c  o  m*/
            dateString = formatter.format(date);
        } catch (IllegalArgumentException iae) {
            iae.printStackTrace();
        }
        return dateString;
    }
}

Related

  1. formattedTimeForFilenames()
  2. formatterDate(Date date, byte format)
  3. formatterFor(final Thread t)
  4. formatTime(Date d)
  5. formatTime(Date d)
  6. formatTime(Date date)
  7. formatTime(Date date)
  8. formatTime(Date date)
  9. formatTime(Date date)