Untitled

 avatar
user_1100245
plain_text
2 years ago
864 B
10
Indexable
if(cellDob.getCellType() == CellType.STRING) {
						String date = cellDob.getStringCellValue();
						LocalDate localDate = LocalDate.parse(date, DateTimeFormatter.ofPattern("dd/MM/yyyy"));
						administrator.setDob(localDate);
					}else {
						Date date = cellDob.getDateCellValue();
						Instant instant = date.toInstant();
						ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());
						LocalDate localDate = zdt.toLocalDate();
						administrator.setDob(localDate);
					}
					Cell cellPhone = row.getCell(3);
					if(cellPhone.getCellType() ==  CellType.STRING){
						administrator.setPhoneNumber(cellPhone.getStringCellValue());
					}else {
						DataFormatter dataFormatter = new DataFormatter();
						String phoneNumber = dataFormatter.formatCellValue(cellPhone);
						administrator.setPhoneNumber(phoneNumber);
					}
Editor is loading...
Leave a Comment