Java Converting Retrieved TimeStamp to Instant Gives Wrong Day
I’ve made a simple method which is used to convert a timestamp retrieved from a database into a LocalDate. However for some reason I keep getting the wrong day in the conversion. I’ve shared the code below. private LocalDate getLocalDateFromTimeStamp(Row row, String key){ return LocalDate.parse(row.getTimestamp(key).toInstant().atZome(ZoneOffset.UTC).toLocalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); } So the date I’m expecting is 2022-12-21 but what… Read More Java Converting Retrieved TimeStamp to Instant Gives Wrong Day