folks!
I’ve got such date entry:
<pubDate>23/06/2011 11:57</pubDate>
I try to parse it:
mDateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm");
item_tag.getChild("pubDate").setEndTextElementListener(new EndTextElementListener() {
@Override
public void end(String body) {
date= new GregorianCalendar(0,0,0).getTime();
try {
date=mDateFormat.parse(body);
} catch (ParseException e) {
e.printStackTrace();
}
}
});
But I get something like that: 23/57/2011 11:57 I get minutes instead of month value
What’s wrong with my code?
Your code looks OK. Check out what do you really pass to this method, or just check what will happen if you insert line like: