Here you can find the source of getYearMonthDay2()
public static String getYearMonthDay2()
//package com.java2s; public class Main { public static String getYearMonthDay2() { java.util.Date date1 = new java.util.Date(); java.sql.Date date3 = new java.sql.Date(date1.getTime()); return date3.toString(); }/*from w ww . j a v a 2s . co m*/ }