Java Hour Format formatDateTime(Calendar time)

Here you can find the source of formatDateTime(Calendar time)

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(Calendar time) 

Method Source Code

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

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

public class Main {
    public static String formatDateTime(Calendar time) {
        if (time == null) {
            return "";
        }//  w w  w.  j  av a 2 s  .  com
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return df.format(time.getTime());
    }
}

Related

  1. formatDateString(String dateString)
  2. formatDateString2(String str_date)
  3. formatDateTime()
  4. formatDateTime(Calendar cal)
  5. formatDateTime(Calendar dateTime)
  6. formatDateTime(Date d)
  7. formatDateTime(Date d)
  8. formatDateTime(Date d)
  9. formatDateTime(Date d)