java - How to map an array index to a certain date? -
i want map index 3d array date. have array (sorteddata[34][12][31]) , have if date selected jcalendar corresponds correct index in array. e.g. date 01/01/1974 selected map sorteddata[0][0][0].
how go doing this? thanks.
use java.util.calendar object day, month , year of date:
calendar calendar = new gregoriancalendar(); calendar.settime(thedate); int year = calendar.get(calendar.year); int month = calendar.get(calendar.month); int day = calendar.get(calendar.day_of_month);
then indices in array using
int = year - 1974; int j = month; int k = day;
Comments
Post a Comment