Java Date to String date2String(String pattern, Date date)

Here you can find the source of date2String(String pattern, Date date)

Description

date String

License

Apache License

Declaration

public static String date2String(String pattern, Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Date;

public class Main {
    public static String date2String(String pattern, Date date) {
        String retStr = "";
        java.text.SimpleDateFormat ff = new java.text.SimpleDateFormat();
        ff.applyPattern(pattern);/*  w ww  .  ja  v  a 2  s  . c  om*/
        retStr = ff.format(date);
        return retStr;
    }
}

Related

  1. date2String(Date source, String formatString)
  2. date2String(Date value)
  3. date2String(java.util.Date date, String format)
  4. date2String(java.util.Date date, String pattern)
  5. date2String(String formater, Date aDate)
  6. date2String2(Date date)
  7. date2StringISO(Date date)
  8. date2StringMD(Date date)
  9. date2StringPattern(Date value, String pattern)