Java Date to String convertToString(java.util.Date date)

Here you can find the source of convertToString(java.util.Date date)

Description

This method returns the string

License

Open Source License

Parameter

Parameter Description

Return

String in dd-MMM-yy format For converting Timestamp object into a String

Declaration

public static String convertToString(java.util.Date date) 

Method Source Code

//package com.java2s;
/*/*from  w ww  .  jav  a2 s .co m*/
 * @(#)ConversionUtil.java
 *
 * Copyright by ObjectFrontier, Inc.,
 * 12225 Broadleaf Lane, Alpharetta, GA 30005, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ObjectFrontier, Inc. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of
 * the license agreement you entered into with ObjectFrontier.
 */

public class Main {
    /**
     * This method returns the string
     * 
     * @param java.util.Date date
     * @return String in dd-MMM-yy format
     * 
     * For converting Timestamp object into a String
     */
    public static String convertToString(java.util.Date date) {

        java.text.SimpleDateFormat out = new java.text.SimpleDateFormat("dd-MMM-yy");
        return out.format(date);

    }
}

Related

  1. convertStringoXSDString(Date date)
  2. convertTimeToString(Date date, String pattern)
  3. convertToString(Date date)
  4. ConvertToString(Date date, String format)
  5. convertToString(Date date, String style)
  6. convertToString(String format, Date date)
  7. date2str(Calendar c)
  8. date2Str(Calendar c, String format)
  9. date2Str(Date aDate)