yearIndex = 4;
timeIndex = 5;
gmtIndex = 6;
} else if( columnCount<5 || columnCount>6 ) {
//#ifdef DLOGGING
Logger logger = Logger.getLogger("RssFormatParser");
logger.warning("Invalid date format: " + dateString);
//#endif
for (int ic = 0; ic < dateString.length(); ic++) {
System.out.println("date=" + ic + "," + dateString.charAt(ic) + "," + (int)dateString.charAt(ic));
}
throw new Exception("Invalid date format: " + dateString);
}
// Day of month
int dayOfMonth = Integer.parseInt( values[ dayOfMonthIndex ] );
// Month
String[] months = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
String monthString = values[ monthIndex ];
int month=0;
for(int monthEnumIndex=0; monthEnumIndex<11; monthEnumIndex++) {
if( monthString.equals( months[ monthEnumIndex ] )) {
month = monthEnumIndex;
}
}
// Year
int year = Integer.parseInt(values[ yearIndex ]);
if(year<100) {
year += 2000;
}
// Time
String[] timeValues = StringUtil.split(values[ timeIndex ], ':');
int hours = Integer.parseInt( timeValues[0] );
int minutes = Integer.parseInt( timeValues[1] );
int seconds = Integer.parseInt( timeValues[2] );
pubDate = getCal(dayOfMonth, month, year, hours,
minutes, seconds);
} catch(Exception ex) {
// TODO: Add exception handling code
System.err.println("parseStdDate error while converting date string to object: " +
dateString + "," + ex.toString());
//#ifdef DLOGGING
Logger logger = Logger.getLogger("RssFormatParser");
logger.severe("parseStdDate error while converting date " +
"string to object: " +
dateString, ex);
//#endif
} catch(Throwable t) {
// TODO: Add exception handling code
System.err.println("parseStdDate error while converting date string to object: " +
dateString + "," + t.toString());
//#ifdef DLOGGING
Logger logger = Logger.getLogger("RssFormatParser");
logger.severe("parseStdDate error while converting date " +
"string to object: " +
dateString, t);
//#endif
}
return pubDate;