Java Date Parse getDateFromFormat(Date date, String type)

Here you can find the source of getDateFromFormat(Date date, String type)

Description

get Date From Format

License

Open Source License

Declaration

public static String getDateFromFormat(Date date, String type) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getDateFromFormat(Date date, String type) {
        SimpleDateFormat dateForma = getSimpleDateFormatsType(type);
        return dateForma.format(date);
    }//from   w w w .  j  a v a 2  s .  com

    /**
     * SimpleDateFormat
     * @param type 
     * @return
     */
    public static SimpleDateFormat getSimpleDateFormatsType(String type) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(type);//
        return dateFormat;
    }
}

Related

  1. getDateFromDateAge(Date currentDate, String age)
  2. getDateFromDatestamp(String datestamp)
  3. getDateFromDateTimeUTCFormat(final String dateString)
  4. getDateFromDCItemTimestamp(String dateTimeStamp)
  5. getDateFromFileName(String fileName)
  6. getDateFromFormattedDate(String dateStr, String format)
  7. getDateFromFormattedTimeStamp( String formattedTimeStamp)
  8. getDateFromIRODSValue(final String irodsValue)
  9. getDateFromISO8601(Object iso8601)