Here you can find the source of formatSDate(java.util.Date date)
Parameter | Description |
---|---|
date | the date |
public static String formatSDate(java.util.Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { /**// w ww . ja va2s . c o m * Format S date. * * @param date the date * @return the string */ public static String formatSDate(java.util.Date date) { if (date == null) return ""; else { SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-M-d HH:mm:ss"); return bartDateFormat.format(date); } } }