DateTime in Java 8

Working with Dates in Java 8 is easy and intuitive.

LocalDateTime currTime =;
int currentYear = currTime.getYear();
int currentMonth = currTime.getMonthValue();

// prepare @datum_start = last day of previous month
LocalDateTime datumStart = 

// prepare @datum_end = first day of next month
LocalDateTime datumEnd = 

//convert to java.util.Date
LocalDateTime ldt = LocalDateTime.ofInstant(in.toInstant(), ZoneId.systemDefault());
Date out = Date.from(ldt.atZone(ZoneId.systemDefault()).toInstant());

More info here.