Hi,
I need to converti a string to date (my region is UTC+2)
out_X= new SimpleDateFormat(dateFormat).parse("20140516");
logger.warn(out_RIFERIMENTODATE);
print: Fri May 16 00:00:00 CEST 2014 that is converted into 2014-05-15T22:00:00.0
Now i add two hours:
public static Date Date2(Date d){
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR, 2);
return cal.getTime();
}
print: Fri May 16 02:00:00 CEST 2014 that is converted into 2014-05-16T00:00:00.0
It works =)
Now i try with these:
out_X = Date2(new SimpleDateFormat(dateFormat).parse("20140216"));
logger.warn("Riferimento_Date 20140216 "+out_RIFERIMENTODATE);
out_X = Date2(new SimpleDateFormat(dateFormat).parse("20140516"));
logger.warn("Riferimento_Date 20140516 "+out_RIFERIMENTODATE);
print:
Sun Feb 16 02:00:00 CET 2014
Fri May 16 02:00:00 CEST 2014
Why one is CEST and one in CET?
Thanks