Android examples for java.util:Calendar Format
calendar Date String as yyyy-MM-dd format
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String calendar2DateString(Calendar calendar) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); return format.format(calendar.getTime()); }/* w w w . j av a2 s . co m*/ }