Here you can find the source of getStrFromDate(Date date)
public static String getStrFromDate(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String today; public static String getStrFromDate(Date date) { Date curDate = date;//from w w w.j a v a 2 s . co m SimpleDateFormat sdf; sdf = new SimpleDateFormat("yyyy-MM-dd"); today = sdf.format(curDate); // today = sdf.format(1000); return today; } }