Java Time Format getFormattedTime(final Date date)

Here you can find the source of getFormattedTime(final Date date)

Description

get Formatted Time

License

Open Source License

Declaration

public static String getFormattedTime(final Date date) 

Method Source Code


//package com.java2s;
import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String SIMPLE_DATE_FORMAT = "yyyyMMddHHmmss";

    public static String getFormattedTime(final Date date) {
        if (date == null) {
            return null;
        }//from w w  w.ja va  2s. c  o m
        return createSimpleFormat().format(date);
    }

    private static DateFormat createSimpleFormat() {
        return new SimpleDateFormat(SIMPLE_DATE_FORMAT);
    }
}

Related

  1. getFormattedFileTime(File f, String format)
  2. getFormattedTime()
  3. getFormattedTime(Date date)
  4. getFormattedTime(Date date)
  5. getFormattedTime(final Calendar calendar)
  6. getFormattedTimeFilesafe(long t)
  7. getFormattedTimeString(double s)
  8. getFormatTime(Date date)
  9. getFormatTime(String format)