Java Date to Time getTime(Date date, String pattern, Locale locale)

Here you can find the source of getTime(Date date, String pattern, Locale locale)

Description

get Time

License

Open Source License

Declaration

public static String getTime(Date date, String pattern, Locale locale) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    static final Locale currentLocale = Locale.getDefault();

    public static String getTime(Date date, String pattern) {
        return getTime(date, pattern, currentLocale);
    }/*from  w w  w.  j  a  va 2s .  c o m*/

    public static String getTime(Date date, String pattern, Locale locale) {
        SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale);
        return formatter.format(date);
    }
}

Related

  1. getTime(Date date)
  2. getTime(Date date)
  3. getTime(Date date)
  4. getTime(Date date)
  5. getTime(Date date, boolean isEnd)
  6. getTime(Date dateParam)
  7. getTime(Date executionTime)
  8. getTime(Date timestamp)
  9. getTime(Date trialTime)