Java dates ’n’ Strings: oh noes 07 Sep, 2010
Today’s Java WTF: parsing a two-digit year value from a time-date value expressed as a String. Meh, that’s not brittle or anything…
String tmp = someDoc.getItemValueString("someDateField");
String arrTmp[] = tmp.split("/");
int year = Integer.parseInt(arrTmp[2]);
That which is seen in one’s IDE cannot be unseen. Don’t do this at home kids.