Here you can find the source of calendarToIso(Calendar c)
public static String calendarToIso(Calendar c)
//package com.java2s; //License from project: LGPL import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; public class Main { private static final DateFormat ISO_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd", Locale.GERMAN); public static String calendarToIso(Calendar c) { return ISO_DATE_FORMAT.format(c.getTime()); }/*from w w w . j ava 2 s. c om*/ }