Java Hour Format formateDate(Date date)

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

Description

formate Date

License

Open Source License

Declaration

public static String formateDate(Date date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String BASE_PATTERN = "yyyy-MM-dd HH:mm:ss";

    public static String formateDate(Date date) {
        return formateDate(date, BASE_PATTERN);
    }//  ww  w .jav  a2s.  c om

    public static String formateDate(Date date, String pattern) {
        if (date == null)
            return null;

        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
        return formatter.format(date);
    }
}

Related

  1. formatDebugMessage(String debugLevel, Object msg)
  2. formatDicomTime(String dicomTime)
  3. formatDuration(long duration)
  4. formatDuration(long value)
  5. formateDataC(Date date)
  6. formateDate(Date date, String format)
  7. forMateDate(String dateStr)
  8. formateDaTime(Date date)
  9. formateEndTimeString(String time)