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