In my Java program, I need to create an instance of the current moment in time. I use
Date date = new Date();
This gives me the current dat
You can use the following code:
LocalDate localDate = LocalDate.now(); int year = localDate.getYear(); int month = localDate.getMonthValue(); int date = localDate.getDayOfMonth();