GregorianCalendar gCalendar = new GregorianCalendar()
Calendar calendar
DateFormat myDateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
def currentDate
def dia = gCalendar.get(Calendar.DAY_OF_MONTH);//dia del mes
def mes = gCalendar.get(Calendar.MONTH);//mes, de 0 a 11
mes+=1
if(mes<=9){mes="0" + mes}
def anio = gCalendar.get(Calendar.YEAR);
currentDate = myDateFormat.parse(String.valueOf(dia) + "/" + String.valueOf(mes) + "/" + String.valueOf(anio) + " 00:00:00")
No hay comentarios:
Publicar un comentario