Java Date to String date2StringPattern(Date value, String pattern)

Here you can find the source of date2StringPattern(Date value, String pattern)

Description

date String Pattern

License

Open Source License

Declaration

public static String date2StringPattern(Date value, String pattern) 

Method Source Code

//package com.java2s;
/*//from  ww  w.  j a  v  a  2 s.c  o  m
 * Copyright (C) 2010 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String date2StringPattern(Date value, String pattern) {
        if (value != null) {
            SimpleDateFormat dateTimeNoSlash = new SimpleDateFormat(pattern);
            return dateTimeNoSlash.format(value);
        }
        return "";
    }
}

Related

  1. date2String(String formater, Date aDate)
  2. date2String(String pattern, Date date)
  3. date2String2(Date date)
  4. date2StringISO(Date date)
  5. date2StringMD(Date date)
  6. Date2StringSec(Date date)
  7. datetime(Date date)
  8. dateTime2String(Date dateTime, DateFormat dateFormat)
  9. dateTimeISO(final java.util.Date date)