Date date = new Date(); SimpleDateFormat df=new SimplDateFormat("yyyy-MM-dd HH:mm:ss"); String today=df.format(date);