I have a number of day of the year. (Today\'s number of the day is 308.) I want to convert this number to a date in SQL format (YYYY/MM/DD). Can I do it in java
YYYY/MM/DD
int dayOfYear = 112; Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_YEAR, dayOfYear); SimpleDateFormat sdf = new SimpleDateFormat("YYYY/MM/dd"); System.out.println("Day of year " + dayOfYear + " = " + sdf.format(calendar.getTime()));
hope above snippets helps you