Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String getTodaysDate() { Calendar c = Calendar.getInstance(); return c.get(Calendar.YEAR) + "-0" + String.valueOf(c.get(Calendar.MONTH) + 1) + "-" + c.get(Calendar.DAY_OF_MONTH); } }