Here you can find the source of getToday()
public static String getToday()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static String getToday() { Calendar now = Calendar.getInstance(); StringBuffer sb = new StringBuffer(); sb.append(now.get(Calendar.YEAR)).append(now.get(Calendar.MONTH) + 1) .append(now.get(Calendar.DAY_OF_MONTH)); return sb.toString(); }/* ww w. j a v a 2 s . c o m*/ }