how to get the only the year of now in java code example
Example: java get year
import java.time.ZoneId;
import java.util.Date;
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear();
import java.time.ZoneId;
import java.util.Date;
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear();