Here you can find the source of toDateString(Calendar cal)
Parameter | Description |
---|---|
cal | a parameter |
public static synchronized String toDateString(Calendar cal)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static DateFormat ibmDateFormat = new SimpleDateFormat("yyyy-MM-dd"); /**// w w w . j a v a2s . c om * @param cal * @return */ public static synchronized String toDateString(Calendar cal) { if (cal != null) { return ibmDateFormat.format(cal.getTime()); } return null; } }