I'm trying to get year from the Date, and with Calendar.get(Calendar.YEAR)
i get year 3917 instead of 2017 ? But when i try to check output with date.getYear()
it returns the correct year.
Date date = new Date(year, month, day);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
Log.d(TAG, "onClick: year "+date.getYear());
Log.d(TAG, "onClick: year "+calendar.get(Calendar.YEAR));
Output:
onClick: year 2017
onClick: year 3917
Date class displays the correct year but Calendar displays wrong year