date - Java SimpleDateFormat parsing issue -
i'm trying parse date string got out of website in java using simpledateformat class, goes wrong , can't figure out why.
the date strings come in following syntax:
"13:37 - tue 28-jun-2011"
so tried doing following:
simpledateformat dateformat = new simpledateformat("hh:mm - eee dd-mmm-yyyy"); parseposition pos = new parseposition(0); date d = dateformat.parse("13:37 - tue 28-jun-2011", pos);
as said before, doesn't work; when print
system.out.println(pos.geterrorindex());
it prints "8", assume means error somewhere around eee part. i've tried different permutations nothing worked. doing wrong?
thanks
bompf
if trying parse date work. dont know trying parseposition
simpledateformat dateformat = new simpledateformat("hh:mm - eee dd-mmm-yyyy"); date d = dateformat.parse("13:37 - tue 28-jun-2011"); system.out.println(d);
Comments
Post a Comment