I am trying to get the Day_of_year from a Datepicker, works but I want to alsom change the day of the year, is there a function like in PHP to change the values.
Code:
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
jDay = c.get(Calendar.DAY_OF_YEAR);
// display the current date (this method is below)
updateDisplay();
}
private void updateDisplay() {
mDateDisplay.setText(
new StringBuilder()
// Month is 0 based so add 1
.append(jDay));
private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
jDay = 123;//need this to change, to get the values from mYear, mMonth and mDay to change the day of the year (jDay).
updateDisplay();
}
};