I got days in year in format 1-366
How do I convert them to actuall date like 12.12. etc.? + how it's with the 29.2.?
Thanks for answer!
I got days in year in format 1-366
How do I convert them to actuall date like 12.12. etc.? + how it's with the 29.2.?
Thanks for answer!
Seems easy to do with Calendar:
final Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_YEAR, 366);
final Date date = new Date(calendar.getTimeInMillis());
And if you want to offset a year for example:
calendar.add(Calendar.YEAR, 1);
You can use joda-time-android:
MutableDateTime mutableDateTime = new MutableDateTime();
mutableDateTime.setYear(2012);
mutableDateTime.setDayOfYear(366);