I have a date on String, like this:
String date=\"25.07.2007\";
And I want to divide it to:
String day;
String month;
String yea
Try this...
String dateArr[] = date.split(".");
String day = dateArr[0];
String month = dateArr[1];
String year = dateArr[2];
or
String day = date.substring(0,2);
String month = date.substring(3,5);
String year = date.substring(6,10);
To get the current date...
Date currentDate = Calendar.getInstance().getTime();
To get day, month and year from current date..
int day = currentDate.get(Calendar.DAY_OF_MONTH);
int month = currentDate.get(Calendar.MONTH);
int year = currentDate.get(Calendar.YEAR);
Month starts at 0 here...