Java Date to String date2String(Date date)

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

Description

This method convert date to format string

License

Open Source License

Parameter

Parameter Description
date a date data type

Return

date string

Declaration

public static String date2String(Date date) 

Method Source Code


//package com.java2s;
/* *************************************************************************
 *
 *          Copyright (c) 2002, SeeBeyond Technology Corporation,
 *          All Rights Reserved/*  www  .  j a  v  a2s  . co m*/
 *
 *          This program, and all the routines referenced herein,
 *          are the proprietary properties and trade secrets of
 *          SEEBEYOND TECHNOLOGY CORPORATION.
 *
 *          Except as provided for by license agreement, this
 *          program shall not be duplicated, used, or disclosed
 *          without  written consent signed by an officer of
 *          SEEBEYOND TECHNOLOGY CORPORATION.
 *
 ***************************************************************************/

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

public class Main {
    static SimpleDateFormat SDFDATE;

    /**
     * This method convert date to format string
     *
     * @param date a date data type
     * @return date string
     */
    public static String date2String(Date date) {
        if (date == null) {
            return "";
        }

        return SDFDATE.format(date);
    }
}

Related

  1. date2string(Date _aDate)
  2. date2string(Date date)
  3. date2string(Date date)
  4. date2String(Date date)
  5. date2String(Date date)
  6. date2String(Date date)
  7. date2String(Date date)
  8. date2string(Date date)
  9. date2String(Date date)