As stated in the Title of the question , i have different days in different accounts, How to get the date part of these
Asked
Active
Viewed 361 times
-2
-
how is the format ? mena mm/dd/yyyy – Chintan Khetiya Nov 07 '12 at 11:31
-
7How can someone with 2k reputation post such a question? Consider adding more details and improving formatting. Vast majority of your questions was improved by other users. You should learn from those edits.. – Michal Klouda Nov 07 '12 at 11:33
1 Answers
1
Just change the date formats below depending on your date format:
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = (Date)formatter.parse(str);
DateFormat df = new SimpleDateFormat("MM"); // you can use 'dd' for date
return df.format(date);
} catch (ParseException e) {
e.printStackTrace();
return null;
}

Rod Michael Coronel
- 512
- 4
- 13