Java Date to String date2String(Date value)

Here you can find the source of date2String(Date value)

Description

date String

License

Open Source License

Parameter

Parameter Description
value Date

Return

String

Declaration

public static String date2String(Date value) 

Method Source Code

//package com.java2s;
/*//from   w w w. j av  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 {
    /**
     *
     * @param value Date
     * @return String
     */
    public static String date2String(Date value) {
        if (value != null) {
            SimpleDateFormat date = new SimpleDateFormat("yyyy/MM/dd");
            return date.format(value);
        }
        return "";
    }
}

Related

  1. date2String(Date date, String format)
  2. date2String(Date date, String format)
  3. Date2String(Date date, String formatPattern)
  4. date2String(Date date, String pattern)
  5. date2String(Date source, String formatString)
  6. date2String(java.util.Date date, String format)
  7. date2String(java.util.Date date, String pattern)
  8. date2String(String formater, Date aDate)
  9. date2String(String pattern, Date date)