String pattern = "yyyy-MM-dd"; SimpleDateFormat df = new SimpleDateFormat(pattern); Date today = new Date(); String tString = df.format(today); return tString;