In the session.xsjslib example we are building a string and therefore JavaScript is perform the output conversion of the timestamp to a string. This is why you see the Thus Sep... formatted output of the timestamp instead of the internal JSON notation of the timestamp.
I just tested and a solution would be to replace the TIMESTAMP handling with the following:
case $.db.types.TIMESTAMP: var dateTemp = new Date(); dateTemp.setDate(rs.getTimestamp(i)); var dateString = dateTemp.toJSON(); value += '"'+dateString+'"'; break;