Calendar.DAY_OF_YEAR
is a constant representing the field that contains the day-of-year. It’s numeric value (6, apparently) has no meaning beyond being not equal to any of the other field constants.
You want
Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
solved Java Calendar Not working [closed]