Here you can find the source of toString(Calendar cal)
Parameter | Description |
---|---|
cal | the Calendar to format |
public static String toString(Calendar cal)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**/* www. j a va 2 s .co m*/ * Get a String representation of the Calendar with its * date and time * @param cal the Calendar to format * @return String representation of Calendar */ public static String toString(Calendar cal) { SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); return sdf.format(cal.getTime()); } }