Answers for "java current date in year"

4

java get current year

import java.util.Calendar;

int year = Calendar.getInstance().get(Calendar.YEAR);
Posted by: Guest on November-06-2020
0

java get current date

SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");  
Date date = new Date();  
System.out.println(formatter.format(date));  

// ------------------------

System.out.println(LocalDate.now());
Posted by: Guest on February-02-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language