Java Hour Format formatFromDate(Date date)

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

Description

format From Date

License

Apache License

Declaration

public static String formatFromDate(Date date) 

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 formatFromDate(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }/* w w  w .  j a  v a 2s.c  o m*/

    public static String formatFromDate(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(date);
    }
}

Related

  1. formatFileDate(Date from)
  2. formatFilesystemOrder(Date date)
  3. formatForCookieExpiry(Date date)
  4. formatForFileName()
  5. formatForHttpHeader(long unixTime)
  6. formatFromString(String date)
  7. formatFullDate(Object date)
  8. formatFullTime(Date date)
  9. formatHDate(java.util.Date date)