Java Hour Format formatDateToHours(Date time)

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

Description

format Date To Hours

License

Apache License

Declaration

public static String formatDateToHours(Date time) 

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 formatDateToHours(Date time) {
        SimpleDateFormat formatter;
        formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String ctime = formatter.format(time);
        return ctime;
    }/*from  www.  j  a  v  a2 s  .  c  o  m*/
}

Related

  1. formatDateTimeForSolr(Date d)
  2. formatDateTimeFull(Date dateTime)
  3. formatDateTimeStringForEquivalentCommand(final Date date)
  4. formatDateToEndDateTime(String strDate)
  5. formatDateToHMSString(java.util.Date date)
  6. formatDateToStr(String format, Date date)
  7. formatDateToString(java.util.Date date, int format)
  8. formatDebugMessage(String debugLevel, Object msg)
  9. formatDicomTime(String dicomTime)