private static PyTimeTuple toTimeTuple(Calendar cal, int isdst) {
int dow = cal.get(Calendar.DAY_OF_WEEK) - 2;
if (dow < 0) {
dow += 7;
}
return new PyTimeTuple(new PyInteger(cal.get(Calendar.YEAR)),
new PyInteger(cal.get(Calendar.MONTH) + 1),
new PyInteger(cal.get(Calendar.DAY_OF_MONTH)),
new PyInteger(cal.get(Calendar.HOUR)
+ 12 * cal.get(Calendar.AM_PM)),
new PyInteger(cal.get(Calendar.MINUTE)),
new PyInteger(cal.get(Calendar.SECOND)),
new PyInteger(dow),
new PyInteger(cal.get(Calendar.DAY_OF_YEAR)),
new PyInteger(isdst));
}