Here you can find the source of date2Str(final Date date, final String dateFormat)
Parameter | Description |
---|---|
date | a parameter |
dateFormat | a parameter |
public static String date2Str(final Date date, final String dateFormat)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* ww w . j ava 2 s . com*/ * * @param date * @param dateFormat * @return */ public static String date2Str(final Date date, final String dateFormat) { SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); try { return sdf.format(date); } catch (Exception e) { return null; } } }